Community
Participate
Working Groups
I'm using Sun VM + JDK 1.4.1. If I set compiler preferences / compiler compliance level to 1.3, I expect to get an error message would I try to use in code any class or method that was introduced in JDK 1.4. But if I type in my program something like that: Boolean.toString(true); // Since 1.4 compiler does not complaine to the compliance violation. I think it worked for 2.0. I aplogize if I missed any other option to activate this feature. This sort of errors is not listed in severety error level pages. Unfortunatelly help doesn't provide more information.
Did you enable the warning in Preferences > Java > Compiler > Build Path>Incompatible Required Libraries ?
Note that we never checked on an individual reference basis.
Incomplete build path : Error Circular dependecies: Error Duplicate resource: Error All other check boxes are checked. There is no field "Incompatible Required Libraries"
This warning is only available in 3.0 stream. Note that as I said, you would not get individual diagnosis, but rather a coarse grain warning/error when setting the classpath. In order to flag individual usage, it would require to perform 2 compile actions, one against jdk1.4 and one again jdk1.3, then compare/notify differences. This would be overkill. It is far simply for you to manually to simply switch your JRE setting for the project match your expectation (see installed JREs preferences, and add the ones you care about).
So what are the compliance options for?
The Eclipse compiler is both a 1.3 and 1.4 compiler. You decide which flavor you want (there are numerous subtle differences in between these, denoting the evolution of the language). Source level allows you to enable/disable 1.4 features like assertions (equivalent to javac -source option). Target level allows you to tag classfiles with target JRE version (equivalent to javac -target option).
OK to close ?
Thanks for explanation. It is a surprise not only for me. I surveyed my colleagues and found that all of them had this illusion about active compliance control. Anyway could you please close this bug report? I apologize for the wrong alarm.
No problem. This would be a cool diagnosis though, but unfortunately unaffordable.
Closing
*** Bug 40378 has been marked as a duplicate of this bug. ***