问题
After installing ADT Plugin for Eclipse, I tried to make a new Hello world Android app.
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.
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.
My compliance levels are also changed to JDK 1.7 only. And I also changed my JRE compliance to 1.7.
回答1:
I was facing the same problem on my Mac OSX and for me the problem was resolved by downloading and installing JDK 1.8 from Java SE Development Kit 8 Downloads. You just need to install(or update to) JDK 1.8 and restart the eclipse. That's it! Should work afterwards.
回答2:
Please check for the following.
- Ensure that you have restarted your system after specifying the path name.
- You can look for the following icon on your eclipse's layout screen. !() The "20" specifies the android version to use when rendering layouts. Change it and see.
- Last but not least review your ADT configurations. Hope this helps.
回答3:
You can "solve" it by uninstalling the Android L SDK using the Android SDK Manager.
Not satisfactory.
Edit
I think this answer is effectively suggesting the same thing but without the uninstalling (instead just selecting the version of the API that actually works).
回答4:
Check your JDK version. It must be JDK1.7. JDK 1.6 does not work.
回答5:
Have had same problem when upgrading to SDK 5.0. As seen in different answers, the solution for me was:
- Download a new JDK (1.8)
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
Didn't need to modify JDK compliance.
回答6:
Just delete Android L platforms. Redirect to your android sdk directory.
adt-bundle-mac-x86_64-20140321/sdk/platforms/android-L
delete directory android-L and restart your eclipse.
回答7:
Sometimes it can be just because the compiler compliance level is not set properly in Eclipse Java Compiler settings.
Go to Eclipse Preferences, under Java section-> go to Compiler and then in JDK compliance level select 1.7
回答8:
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+
来源:https://stackoverflow.com/questions/24886468/parsing-data-for-android-l-failed-unsupported-major-minor-version-51-0