Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java compiler conflict?(How to resolve warning message)
Java compiler conflict? [message #987742] Tue, 27 November 2012 16:06 Go to next message
Tony Walker is currently offline Tony Walker
Messages: 8
Registered: November 2012
Junior Member
I'm getting the following message:

"Description Resource Path Location Type
Incompatible .class files version in required binaries. Project 'XXX' is targeting a 1.6 runtime, but is compiled against 'C:Program Files/Java/jdk1.7.0_02/jre/lib/rt.jar' (from the container 'JRE System Library [jdk1.7.0_02]') which requires a 1.7 runtime XXX Build path Build Path Problem"

It appears to be saying my project, XXX, is requesting a 1.6 runtime (which I'm not intending to do) and is using the 1.7 compiler (which is correct). I want to get a 1.7 runtime but I can't figure out where the project is specifying a 1.6 runtime so that I can correct it.

Help!!

Tony
Re: Java compiler conflict? [message #990279 is a reply to message #987742] Tue, 11 December 2012 12:03 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 28.11.2012 16:50, Tony Walker wrote:
> I'm getting the following message:
>
> "Description Resource Path Location Type
> Incompatible .class files version in required binaries. Project 'XXX'
> is targeting a 1.6 runtime, but is compiled against 'C:Program
> Files/Java/jdk1.7.0_02/jre/lib/rt.jar' (from the container 'JRE System
> Library [jdk1.7.0_02]') which requires a 1.7 runtime XXX
> Build path Build Path Problem"
>
> It appears to be saying my project, XXX, is requesting a 1.6 runtime
> (which I'm not intending to do) and is using the 1.7 compiler (which
> is correct). I want to get a 1.7 runtime but I can't figure out where
> the project is specifying a 1.6 runtime so that I can correct it.
Change the compiler compliance on the project's property page.

Dani
>
> Help!!
>
> Tony
>
Re: Java compiler conflict? [message #990306 is a reply to message #990279] Tue, 11 December 2012 13:38 Go to previous messageGo to next message
Tony Walker is currently offline Tony Walker
Messages: 8
Registered: November 2012
Junior Member
Well I had already looked there and it says 1.7. I've also looked through all the other configuration pages and can't find anywhere that might indicate a Java 6 runtime.
Re: Java compiler conflict? [message #990383 is a reply to message #990306] Wed, 12 December 2012 04:09 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 11.12.2012 19:38, Tony Walker wrote:
> Well I had already looked there and it says 1.7. I've also looked
> through all the other configuration pages and can't find anywhere that
> might indicate a Java 6 runtime.
Maybe you run into https://bugs.eclipse.org/396299 . Try whether closing
and then re-opening your project fixes the issue.

Dani
Re: Java compiler conflict? [message #990495 is a reply to message #990383] Wed, 12 December 2012 13:12 Go to previous messageGo to next message
Tony Walker is currently offline Tony Walker
Messages: 8
Registered: November 2012
Junior Member
Thanks for trying to help, Dani.

I looked at the bug and I don't see the relevance. So far as I can see I haven't requested a 1.6 runtime anywhere -- I don't know where Eclipse is getting this from. My best guess is that it's in one of the configuration files somewhere, but I've not tried looking through them all. I did that once before and it takes forever, specially when you don't know exactly what you're looking for!

And no, closing the project and re-opening it doesn't fix the problem. Nor does closing and re-opening Eclipse or re-booting Windows 7.

Thanks again,

Tony
Re: Java compiler conflict? [message #990503 is a reply to message #990495] Wed, 12 December 2012 14:03 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1336
Registered: July 2009
Senior Member
Check what you have configured for the JRE on the Libraries tab of your Project Build Path. Is this set to a 1.6 Execution Environment?
Re: Java compiler conflict? [message #990656 is a reply to message #990503] Thu, 13 December 2012 11:05 Go to previous messageGo to next message
Tony Walker is currently offline Tony Walker
Messages: 8
Registered: November 2012
Junior Member
No. Thanks for trying but I'm not a newbie and I've looked in all the obvious and not so obvious places. My best guess is that this is a bug caused by a screwed up configuration file -- possibly generated during the upgrade to Indigo, but that's just a guess.

I don't want to go poking through the configuration files because it's time consuming and easy to make a bigger mess if I change something. I was hoping that someone had come across this and had figured it out.

Regards,

Tony
Re: Java compiler conflict? [message #990659 is a reply to message #987742] Thu, 13 December 2012 11:19 Go to previous messageGo to next message
Tony Walker is currently offline Tony Walker
Messages: 8
Registered: November 2012
Junior Member
More information:

This problem seems to be present in all my Java projects indicating it's a system-wide issue.

Also, I just tried setting the JDK compliance to 1.6, rebuild, and back to 1.7 and rebuild. The problems doesn't go away after either rebuild

I'm using JDK1.7.0_02 and I've removed all earlier JDKs so that's the only one Eclipse knows about.

I should mention that the problem doesn't appear to cause any problems in generating and running jars -- it's just annoying because I don't have a clean build so I have to keep checking manually to see if there are any other issues.

Tony
Problem fixed [message #990668 is a reply to message #990503] Thu, 13 December 2012 11:43 Go to previous messageGo to next message
Tony Walker is currently offline Tony Walker
Messages: 8
Registered: November 2012
Junior Member
I just upgraded my JDK to JDK1.7.0_10 and rebuilt everything and the problem went away.

Go figure!

Tony
Re: Problem fixed [message #1012129 is a reply to message #990668] Wed, 20 February 2013 18:45 Go to previous message
Randheer Thayambath is currently offline Randheer Thayambath
Messages: 1
Registered: February 2013
Junior Member
Had same issue.. tried reinstalling jdk 1.7.. didn't fix it.

Deleted all the "markers" (that shows the list of compilation errors) from within eclipse (right click and just delete) and rebuild all projects... solved the errors. It looks like eclipse was not rebuilding projects properly once this error happens.. you just have to force it.
Previous Topic:How can I create a "Source Folder" browser
Next Topic:Scrollable Tabs
Goto Forum:
  


Current Time: Fri Aug 29 04:16:14 EDT 2014

Powered by FUDForum. Page generated in 0.17856 seconds