5

When I compile / run the build on ant with eclipse neon on JDK 7 and below I got error message saying Unsupported must run on 1.8 or higher. If I changed my ant and jdk to 8 on ant I got unsupported minior/major version....

Is there a way to build with jdk 7 and below with eclipse neon? if I made this upgrade am I sacrificing all my previous changes and development?

logger
  • 1,983
  • 5
  • 31
  • 57
  • check your build.xml, you must have defined jdk version 1.8 but jdk on your system is lower than 1.8 – Boola Jun 28 '16 at 12:42
  • Not sure what is wrong in your setup; but I have a 1.7 and a 1.8 JDK defined within my preferences for eclipse-neon; and depending on some context; stuff gets build for either of them; without any problems. As Boola says; I guess there is one part of your system that says "I need 1.8", and you are only "giving" that component the 1.7 JDK. – GhostCat Jun 28 '16 at 12:47

3 Answers3

9

Eclipse Neon itself must be run using Java 8.

You can still use older Java versions to run your programs. Configure the available JRE/JDKs in the Preferences in 'Java > Installed JREs'. Then configure your project or Run Configuration to choose the version you want to use.

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • but with this wont you run into unsupported minor/major version 53.0? – logger Jun 28 '16 at 13:03
  • 1
    Not if you configure your project's JDK Compliance settings properly in the Project 'Java Compiler' settings. – greg-449 Jun 28 '16 at 13:05
  • It seems I still got the error but it was fixed after I adjusted my class path system environment variable to the compliance level to be the same. – logger Jun 28 '16 at 13:07
2

You can edit like this following(make sure with your installation path),

-vm
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin 
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:+UseG1GC
-XX:+UseStringDeduplication
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx1024m
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
K.Suthagar
  • 2,226
  • 1
  • 16
  • 28
0

Ideally Neon should be run on java 1.8 but you can run neon on java 1.7

just change the java version in eclipse.ini file. Dosgi.requiredJavaVersion=1.7

GAURAV ROY
  • 1,885
  • 1
  • 12
  • 4