Android - “解析 android-21 的数据失败”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26474298/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android - "Parsing Data for android-21 failed"
提问by warbi
Had the following error in Eclipse after installing Android 5.0 (SDK 21)
安装 Android 5.0 (SDK 21) 后在 Eclipse 中出现以下错误
"Loading data for Android 5.0" has encountered a problem.
Parsing Data for android-21 failed
unsupported major.minor version 51.0
“为Android 5.0加载数据”遇到问题。
解析 android-21 的数据失败,
不受支持的 Major.minor 版本 51.0
回答by warbi
Try installing JDK 1.8 and reload Eclipse.
尝试安装 JDK 1.8 并重新加载 Eclipse。
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
回答by Amit
Initially I was facing the same issue. I upgraded to JDK1.7. Still issue persist. This is due to the fact that some time eclipse takees the default sdk as 1.6. To resolve this:
最初我面临着同样的问题。我升级到JDK1.7。问题依然存在。这是因为有一段时间 eclipse 将默认 sdk 设为 1.6。要解决此问题:
- Change the environmental path to point 1.7/1.8
- Open Eclipse and goto windows tab-> preference
- Goto Java->complier and set Compiler compliance level to 1.7 and press apply.
- Then Goto Installed JRE Section. check if the installed jdk is listed and selected in the list. If not listed give the manual path using search. then select the jdk version and remove other versions in the list.
- in installed JRE go to execution environment and select the intended java se version and check it in compatible section
- Presss ok and restart Eclipse.
- 将环境路径改为指向1.7/1.8
- 打开 Eclipse 并转到窗口选项卡-> 首选项
- 转到 Java->complier 并将编译器合规性级别设置为 1.7,然后按应用。
- 然后转到安装的 JRE 部分。检查已安装的jdk是否在列表中列出并选择。如果未列出,请使用搜索提供手动路径。然后选择jdk版本并删除列表中的其他版本。
- 在已安装的 JRE 中转到执行环境并选择预期的 java se 版本并在兼容部分检查它
- 按确定并重新启动 Eclipse。
This should resolve the issue.
这应该可以解决问题。
回答by Tarun Sharma
I tried all above mention step, but not able to solve the problem. After some research, I got Solution of my problem.
我尝试了上述所有步骤,但无法解决问题。经过一番研究,我得到了我的问题的解决方案。
check eclipse.ini to see -vm, (like "C:/Program Files/Java/jre7/bin/javaw.exe").
检查 eclipse.ini 以查看 -vm,(如“C:/Program Files/Java/jre7/bin/javaw.exe”)。
i also have the problem you said and i found eclipse is started with java6. after i modify to use java7, there are no such fail dialog.
我也有你说的问题,我发现eclipse是用java6启动的。在我修改为使用 java7 后,没有这样的失败对话框。
- So need to update SDK to 1.8 or 1.7.
- set compiler to 1.7 or 1.8..
- then check eclipse.ini
- 所以需要更新SDK到1.8或者1.7。
- 将编译器设置为 1.7 或 1.8..
- 然后检查eclipse.ini
回答by Jais Joy
Installing JDK 1.8 and reload Eclipse worked for me
安装 JDK 1.8 并重新加载 Eclipse 对我有用
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html