7

I am currently using Eclipse Mars (64 bit) on Windows 7 64 bit OS. I have installed JDK 1.7 (64 bit). I was using this Eclipse for since a month now with the ADT plugin installed from the beginning.

However, recently when I updated my Android SDK to include the latest Android N platform, I am getting errors while running any Android project in my workspace.

The error is as follows,

Android Package Builder Error: Unable to build project "HelloWorld" Unsupported major minor version 52.0

However, when I tried the same on Eclipse Juno (64 bit) on another Windows 7 64 bit system with JDK 1.7 (64 bit) then I didn't face any such issue.

Is this a problem with Eclipse or Java?

enter image description here

Parth Doshi
  • 4,200
  • 15
  • 79
  • 129
  • Are you sure you are using JDK 1.7? You can double check the JDK compliance on the project by right clicking the project -> properties -> Java Compiler. – George Mulligan Mar 31 '16 at 15:57
  • yes..i have attached screenshot of the same – Parth Doshi Mar 31 '16 at 16:09
  • Probably should have just had you double check the Installed JREs. Window -> Preferences -> Java -> Installed JREs. Sorry if this isn't helpful. I use Android Studio and can successfully build/run my app using JDK 1.8 as long as I set the correct compile options to target 1.7 in gradle files. Not sure what the equivalent is in eclipse as I thought it would have been the JDK compliance setting. – George Mulligan Mar 31 '16 at 17:28
  • I have cross checked the JRE. It points to the correct path. I have the same Android SDK for Android Studio which does not result in any such error like Eclipse. Android Studio is working fine. Its just that the eclipse is now started giving problems. Also, the update of the SDK was normal. I dont think any files are missing. – Parth Doshi Mar 31 '16 at 17:35
  • hi @GeorgeMulligan: is there any other solution. Please help – Parth Doshi Apr 02 '16 at 03:04
  • Unfortunately I'm not much help without access to the environment. I upvoted your question hoping someone else would know the issue. Things you might want to try/verify: There must be a JDK 1.8 installed. Check all configuration files and make sure all are using 1.7. One to double check that fixed there issue for another user can be found [here](http://stackoverflow.com/questions/36008207/how-to-run-android-code-in-eclipse). Try referencing the older Android build tools and library dependencies. Try creating a new workspace and create a new Android project to see if the issue is still there. – George Mulligan Apr 02 '16 at 16:16

1 Answers1

13

I think I might have found the answer for this. Not sure if my conclusions are correct but this fix worked for me:

In your project.properties file add the following:

sdk.buildtools=<something lower than 24.x>

In my case it was 23.0.3.

The conclusion part, someone correct me if I'm wrong here: It seems like the newer version of Android Build Tools uses JDK version 1.8. In my case, I'm using Android Studio and Eclipse (Eclipse for an old project) and Android Studio installed the latest build tools.

Larcho
  • 536
  • 5
  • 10