37

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.

sasu
  • 411
  • 1
  • 4
  • 4
  • please review the ADT configurations – Maveňツ Jul 22 '14 at 11:52
  • 20
    How do they expect to attract and keep developers when the very first tutorial you come to do, following their detailed step-by-step instructions then goes and fails. Amazing. – AJP Aug 08 '14 at 23:00
  • possible duplicate of [Unsupported major.minor version 51.0](http://stackoverflow.com/questions/10382929/unsupported-major-minor-version-51-0) – Sufian Nov 24 '14 at 04:58

8 Answers8

48

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.

K M Rakibul Islam
  • 33,760
  • 12
  • 89
  • 110
  • 4
    Indeed, it works! Thank you! Please note you needn't to switch Java compiler to 1.8 (or 1.7) in your project properties. You just need JDK update and restart eclipse. – iutinvg Nov 13 '14 at 05:17
  • 1
    YES. Thanks mate. 3 days search and nothing. and now I am one happy developer :) – Mr H Nov 21 '14 at 22:00
  • 1
    Glad to know that it helped. I know how it feels :) – K M Rakibul Islam Nov 21 '14 at 22:59
  • I already have an Android app for target 21 working. This problem came up when creating a new app. There should be a workaround without needing to install 1.8, otherwise my other apps wouldn't be working. I'll update once I solve it. – Rudolf Real Dec 04 '14 at 19:51
  • 1
    if it doesn't work the first time you run eclipse after installed jdk 1.8, try rebooting the computer – I'm_With_Stupid Dec 04 '14 at 22:07
10

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.
Ahmad Aghazadeh
  • 16,571
  • 12
  • 101
  • 98
Srijith
  • 1,695
  • 17
  • 29
4

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).

Community
  • 1
  • 1
AJP
  • 26,547
  • 23
  • 88
  • 127
4

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

Ligen Yao
  • 641
  • 1
  • 6
  • 6
3

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

  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
    

Didn't need to modify JDK compliance.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
  • JasonMArcher, I've solved my problem with this approach. I also had my eclipse.ini pointing to a specific ( and older ) jdk. I solved the issue pointing to the jdk 1.7. Good job! – Natan Lotério Feb 24 '15 at 13:48
  • adding ````Dosgi.requiredJavaVersion=1.6```` in config.ini file fixed my problem. – Nirav Dangi Nov 14 '15 at 11:48
1

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.

Community
  • 1
  • 1
tounaobun
  • 14,570
  • 9
  • 53
  • 75
1

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

ngrashia
  • 9,869
  • 5
  • 43
  • 58
Haimanti
  • 11
  • 2
1

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+

user608578
  • 211
  • 2
  • 5