44

Had the following error in Eclipse after installing Android 5.0 (SDK 21)

"Loading data for Android 5.0" has encountered a problem.

Parsing Data for android-21 failed
unsupported major.minor version 51.0

warbi
  • 2,725
  • 2
  • 20
  • 26

4 Answers4

54

Try installing JDK 1.8 and reload Eclipse.

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

warbi
  • 2,725
  • 2
  • 20
  • 26
  • 1
    That worked me, thanks. I used JDK1.6_45 before. I suspect installing JDK 1.7 would also work, as 1.7 has major version 51: http://stackoverflow.com/questions/10382929/unsupported-major-minor-version-51-0 – arberg Oct 23 '14 at 12:27
  • 2
    I'm confirming @arberg's guess... After getting 1.8 to work, I went back to 1.7 (u80), and that worked as well. For me, it seemed (for no reason I could figure out) that I needed to start and restart Eclipse (each JDK change required me to open Eclipse twice (and let all the build processes complete) in order for stuff to work. – Mike Nov 20 '14 at 23:52
  • Lifesaver, thanks! To be clear, my issue came about when I transferred to a new computer. I reinstalled Eclipse and had to drag/drop my Eclipse projects into the new workspace. At first I thought it was my SDK packages were not fully installed, but then it didn't help. When trying to import a project it would have every error in the book (all red)... only adding this JDK recommended helped. I have a Mac. +1! – Azurespot Nov 29 '14 at 04:34
  • HI @NoniA. Did you resolved it? I have same trouble with you. When I switch the eclipse workspace it's will be error.But it's will work fine that I restart my Mac then start eclipse. – jhondge Dec 16 '14 at 10:31
  • @jhondge Yes, I did! Adding that JDK helped. Although I realize I need to change to Android Studio soon, as it won't get support from Google anymore soon. – Azurespot Dec 17 '14 at 06:03
  • To help prevent this in the future with the new Andmore project, which is picking up development where eclipse ADT left off, I've created the following bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=460024. Going forward we'll probably require at least JDK 7 to run to keep compatibility with the latest SDK from Android. – kingargyle Feb 16 '15 at 14:57
  • Yes, you need to restart Eclipse. – Ryan H. Jan 18 '16 at 21:35
11

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:

  1. Change the environmental path to point 1.7/1.8
  2. Open Eclipse and goto windows tab-> preference
  3. Goto Java->complier and set Compiler compliance level to 1.7 and press apply.
  4. 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.
  5. in installed JRE go to execution environment and select the intended java se version and check it in compatible section
  6. Presss ok and restart Eclipse.

This should resolve the issue.

Dax
  • 6,908
  • 5
  • 23
  • 30
Amit
  • 225
  • 2
  • 14
3

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

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.

  • So need to update SDK to 1.8 or 1.7.
  • set compiler to 1.7 or 1.8..
  • then check eclipse.ini
Tarun Sharma
  • 824
  • 1
  • 11
  • 24
  • Strange as it sounds switching to 1.7, and then back to 1.6 worked for me. I picked 1.6 because my project needs to be compatible with android API 10, and 1.8 only forks with API 17 (kitkat?) and up. – Josh Oct 20 '15 at 10:52
0

Installing JDK 1.8 and reload Eclipse worked for me

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Jais Joy
  • 81
  • 1
  • 5