Community
Participate
Working Groups
My org.eclipse.core.expressions.tests project issues strange compiler warnings. Incompatible .class files version in required binaries. Project 'org.eclipse.core.expressions.tests' is targeting a 1.2 runtime, but is compiled against 'C:apps/java/jdk1.4.2/jre/lib/ext/dnsns.jar' which requires a 1.4 runtime org.eclipse.core.expressions.tests My compiler settings are: Compiler compliance level: 1.4 which default compliance settings Using JDK 1.4.2 as JRE. I was only able to get rid of the error by changing the default compliance settings to 1.4 for the generated class files.
We have set Compiler->Build Path->Incompatible required libraries set to warnings.
By default, 1.4 is generating for 1.2 runtimes (-target 1.2), for backward compatibility purpose. This warning however tells you that you are compiling code against binaries which are stamped as 1.4 specific, and not 1.2 as you may think you are. By saying you mean to target a 1.4 runtime, then everything is fine again. Ok to close?
Can this cause troubles? If so, why is this default for developing Eclipse?
I agree with Dani.
We follow the standards of JDKs, defining our own defaults could surprise other users.
i.e. you recommend to ignore this test and use the defaults, right?
If you really mean to use dnsns.jar, I recommend to pump up the target level to 1.4, if not, I suggest you remove it from your JDK since it is polluting your 1.2 compatibility. Personally, I am disabling this warning alltogether.
OK. I guess we can close this one then.
Closing
Jus for the record. You get this error also on rt.jar. I only copied the first out of six. So this isn't only an issue with dnsns.jar.
Fair enough, this indicates that if you compile against this rt.jar, you'd better ensure you tag your classfiles as 1.4 based then. The only argument for keeping it 1.2 by default, is to match other compiler vendors.
i.e. you advise us to set the generated class file compatibility to 1.4 for Eclipse 3.1 development?