Java Android L 解析数据失败。不支持的major.minor 版本51.0

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24886468/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 15:22:49  来源:igfitidea点击:

Parsing data for Android L failed.Unsupported major.minor version 51.0

javaandroideclipsewindows-8eclipse-adt

提问by sasu

After installing ADT Plugin for Eclipse, I tried to make a new Hello world Android app.

为 Eclipse 安装 ADT 插件后,我尝试制作一个新的 Hello world Android 应用程序。

But I met with the following error when I tried to open a new Android Application. I'm working with JDK 7.0 and JRE 7.0.I initially worked with JDK 6.0, but met with the same error, hence I uninstalled it and installed JDK 7.0 and changed the path settings respectively.

但是当我尝试打开一个新的 Android 应用程序时遇到了以下错误。我正在使用JDK 7.0 和 JRE 7.0。我最初使用 JDK 6.0,但遇到了同样的错误,因此我卸载了它并安装了 JDK 7.0 并分别更改了路径设置。

The error clearly is:

错误显然是:

Loading data for Android L(Preview) has encountered a problem. Parsing data for Android L failed.Unsupported major.minor version 51.0.

为 Android L(预览版)加载数据时遇到问题。为 Android L 解析数据失败。不支持主要版本。次要版本 51.0。

My compliance levels are also changed to JDK 1.7 only. And I also changed my JRE compliance to 1.7.

我的合规性级别也仅更改为 JDK 1.7。我还将我的 JRE 合规性更改为 1.7。

回答by Srijith

Please check for the following.

请检查以下内容。

  1. Ensure that you have restarted your system after specifying the path name.
  2. You can look for the following icon on your eclipse's layout screen. !(enter image description here) The "20" specifies the android version to use when rendering layouts. Change it and see.
  3. Last but not least review your ADT configurations. Hope this helps.
  1. 确保在指定路径名后重新启动了系统。
  2. 您可以在日食的布局屏幕上查找以下图标。!( 在此处输入图片说明) "20" 指定渲染布局时使用的 android 版本。改变它,看看。
  3. 最后但并非最不重要的是检查您的 ADT 配置。希望这可以帮助。

回答by AJP

You can "solve" it by uninstalling the Android L SDK using the Android SDK Manager.

您可以通过使用 Android SDK Manager 卸载 Android L SDK 来“解决”它。

Not satisfactory.

不满意。

Edit

编辑

I think this answeris effectively suggesting the same thing but without the uninstalling (instead just selecting the version of the API that actually works).

我认为这个答案有效地暗示了同样的事情,但没有卸载(而只是选择实际工作的 API 版本)。

回答by Ligen Yao

Check your JDK version. It must be JDK1.7. JDK 1.6 does not work.

检查您的 JDK 版本。必须是JDK1.7。JDK 1.6 不起作用。

回答by tounaobun

Just delete Android L platforms. Redirect to your android sdk directory.

只需删除 Android L 平台即可。重定向到您的 android sdk 目录。

adt-bundle-mac-x86_64-20140321/sdk/platforms/android-L

delete directory android-L and restart your eclipse.

adt-bundle-mac-x86_64-20140321/sdk/platforms/android-L

删除目录 android-L 并重新启动 eclipse。

回答by Haimanti

Sometimes it can be just because the compiler compliance level is not set properly in Eclipse Java Compiler settings.

有时可能只是因为在 Eclipse Java Compiler 设置中未正确设置编译器合规性级别。

Go to Eclipse Preferences, under Java section-> go to Compiler and then in JDK compliance level select 1.7

转到 Eclipse 首选项,在 Java 部分下-> 转到编译器,然后在 JDK 合规性级别中选择 1.7

回答by K M Rakibul Islam

I was facing the same problem on my Mac OSXand for me the problem was resolved by downloading and installing JDK 1.8from Java SE Development Kit 8 Downloads. You just need to install(or update to) JDK 1.8and restart the eclipse. That's it! Should work afterwards.

我在Mac OSX遇到了同样的问题,对我来说,通过从Java SE Development Kit 8 Downloads下载和安装JDK 1.8解决了这个问题。您只需要安装(或更新到)JDK 1.8并重新启动 eclipse。就是这样!之后应该工作。

回答by user3394858

Have had same problem when upgrading to SDK 5.0. As seen in different answers, the solution for me was:

升级到 SDK 5.0 时遇到了同样的问题。从不同的答案中可以看出,对我来说,解决方案是:

  1. Download a new JDK (1.8)
  2. Update my Eclipse config file with the location of the new JDK:

    org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile
    -vm C:/jdk1.8.0_25/bin/javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m
    
  1. 下载新的 JDK (1.8)
  2. 使用新 JDK 的位置更新我的 Eclipse 配置文件:

    org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile
    -vm C:/jdk1.8.0_25/bin/javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m
    

Didn't need to modify JDK compliance.

不需要修改 JDK 合规性。

回答by user608578

I was using Eclipse Indigo 64 bit with JDK 1.7. As soon as I updated to Eclipse Luna 64 bit everything worked fine. Furthermore, Eclipse Indigo 64 wouldn't even acknowledge JDK 1.8+

我在 JDK 1.7 中使用 Eclipse Indigo 64 位。我更新到 Eclipse Luna 64 位后一切正常。此外,Eclipse Indigo 64 甚至不承认 JDK 1.8+