Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » eclipse ant won't compile target 1.6 in jdk 7(Building using ant from eclipse fails with java.lang.UnsupportedClassVersionError)
eclipse ant won't compile target 1.6 in jdk 7 [message #1013048] Fri, 22 February 2013 17:08 Go to next message
Franck Routier is currently offline Franck RoutierFriend
Messages: 2
Registered: February 2013
Junior Member
I have eclipse running under OpenJDK 7.
My setting for java/compiler/compliance level is 1.6.
My ant target for javac specify target=1.6.

Compiling in eclipse Workspace works.
Compiling with ant from console work and javap -verbose confirms the produced bytecode is 50.0.

But if I try to 'Run as/Ant build' my build.xml under eclipse, I get the following error:

java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 51.0

I must be missing some setting somewhere, but I can find where ?

Franck
Re: eclipse ant won't compile target 1.6 in jdk 7 [message #1013172 is a reply to message #1013048] Fri, 22 February 2013 23:48 Go to previous messageGo to next message
Olivier Thomann is currently offline Olivier ThomannFriend
Messages: 518
Registered: July 2009
Senior Member
What VM are you using to run your ant task?
You have .class files on your classpath that don't match the VM you are using.

HTH,

Olivier
Re: eclipse ant won't compile target 1.6 in jdk 7 [message #1013275 is a reply to message #1013172] Sat, 23 February 2013 07:05 Go to previous message
Franck Routier is currently offline Franck RoutierFriend
Messages: 2
Registered: February 2013
Junior Member
Well, the jdk used by default on the system is OpenJDK1.7. Eclipse runs in JDK 1.7. When I run ant from console it runs under jdk 1.7. So I guess ant run from eclipse is somehow picking jre 1.6 to run... is there any setting I could alter to change that ?
Previous Topic:eclipse plugin error
Next Topic:Web project in 3.8.0
Goto Forum:
  


Current Time: Sat Apr 20 01:00:31 GMT 2024

Powered by FUDForum. Page generated in 0.09629 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top