Bug 73036 - Strange compiler warning
Summary: Strange compiler warning
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-01 05:40 EDT by Dirk Baeumer CLA
Modified: 2004-10-27 06:59 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2004-09-01 05:40:47 EDT
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.
Comment 1 Dirk Baeumer CLA 2004-09-01 06:05:26 EDT
We have set Compiler->Build Path->Incompatible required libraries set to 
warnings.
Comment 2 Philipe Mulet CLA 2004-09-01 06:43:23 EDT
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?
Comment 3 Dani Megert CLA 2004-09-01 07:10:00 EDT
Can this cause troubles? If so, why is this default for developing Eclipse?
Comment 4 Dirk Baeumer CLA 2004-09-01 10:52:56 EDT
I agree with Dani.
Comment 5 Philipe Mulet CLA 2004-09-02 11:59:07 EDT
We follow the standards of JDKs, defining our own defaults could surprise 
other users. 
Comment 6 Dani Megert CLA 2004-09-02 12:46:29 EDT
i.e. you recommend to ignore this test and use the defaults, right?
Comment 7 Philipe Mulet CLA 2004-09-03 04:31:29 EDT
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.
Comment 8 Dani Megert CLA 2004-09-03 04:42:52 EDT
OK. I guess we can close this one then.
Comment 9 Philipe Mulet CLA 2004-09-03 06:28:12 EDT
Closing
Comment 10 Dirk Baeumer CLA 2004-09-06 05:58:51 EDT
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.
Comment 11 Philipe Mulet CLA 2004-09-06 09:03:36 EDT
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.
Comment 12 Dani Megert CLA 2004-09-06 09:22:05 EDT
i.e. you advise us to set the generated class file compatibility to 1.4 for
Eclipse 3.1 development?