| Author |
Message |
|
|
Post subject: why am i getting this compiler compliance level error?
Posted: Aug 02, 2009 - 05:03 PM
|
|
Joined: Aug 02, 2009
Posts: 12
|
|
Hi all,
I am confused with what really "compiler compliance level" means.
I am trying to make a "web project" in myeclipse 7.5 with the default compiler compliance level of 1.6 and the default jdk6 that comes with it. However, it gives me "Incompatible Java Compliance Level" error, if i follow the steps as listed below:
1- Open myeclipse ide in my default workspace (d:\__nece)
2- File -> New -> Web Project
3- Enter name of project as "e6"
4- Select J2EE specification level to be "Java EE 5.0"
5- Click "Finish"
My installation details are as follows:
| Code: |
*** Date:
Sunday, August 2, 2009 7:01:42 PM AST
** System properties:
OS=WindowsXP
OS version=5.1.0
Java version=1.6.0_13
*** MyEclipse details:
MyEclipse Enterprise Workbench
Version: 7.5
Build id: 7.5-20090609
*** Eclipse details:
MyEclipse Enterprise Workbench
Version: 7.5
Build id: 7.5-20090609
Eclipse Plug-in Development Environment
Version: 3.4.2.R342_v20090122-7T7U1E9imVKz-A8Vz-p_jRS
Build id: M20080703-0800
Eclipse Platform
Version: 3.4.2.R342_v20090122-9I96EiWElHi8lheoJKJIvhM3JfVsYbRrgVIWL
Build id: M20090211-1700
Eclipse Graphical Editing Framework GEF
Version: 3.4.2.v20090218-1145-67728084A56B4I233613552
Build id: 200809101400
Eclipse RCP
Version: 3.4.200.R342_v20090122-989JESTEbig-SVaL8UJHcYBr4A63
Build id: M20090211-1700
Eclipse Java Development Tools
Version: 3.4.2.r342_v20081217-7o7tEAoEEDWEm5HTrKn-svO4BbDI
Build id: M20090211-1700
Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-showsplash
-launcher
C:\Program Files\Genuitec\MyEclipse 7.5\myeclipse.exe
-name
Myeclipse
--launcher.library
C:\Program Files\Genuitec\MyEclipse 7.5\../Common\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\eclipse_1115.dll
-startup
C:\Program Files\Genuitec\MyEclipse 7.5\../Common\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar
-clean
-configuration
configuration
-clean
-vm
C:\Program Files\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\bin\client\jvm.dll
|
|
|
|
| |
|
|
|
 |
|
|
Post subject: RE: why am i getting this compiler compliance level error?
Posted: Aug 03, 2009 - 09:25 AM
|
|
Registered Member


Joined: Feb 03, 2009
Posts: 3442
|
|
mnsharif,
Are you referring to the below screenshot? It is not an error but a warning. If you right click on your project and go to Properties > Java Compiler. It will show you the compiler compliance level is 1.5 because you have selected the J2EE Specification Level as Java EE5.0.
You can set your Compiler's JDK compliance here - From MyEclipse menu options click on Window > Preferences > Java > Compiler. |
_________________ Joy
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject: i see, but...
Posted: Aug 03, 2009 - 10:15 AM
|
|
Joined: Aug 02, 2009
Posts: 12
|
|
Hey Joy,
Thanks for your response.
| Quote: | | Are you referring to the below screenshot? |
Yes, exactly. But the fact that it is a warning only, does this mean that i can configure my application to us J2EE5.0 specification level and still keep the compiler compliance level to be 1.6?
| Quote: | | It will show you the compiler compliance level is 1.5 because you... |
No, it does not because i clicked on "No" when it asked me for "Do you want to use a custom setting for your project?" I want to use 1.6 as compliance level, so i clicked on "No" and therefore, it shows me compliance level as "1.6" (which is default for the workspace).
| Quote: | | ... because you have selected the J2EE Specification Level as Java EE5.0. |
Correct me if i am wrong, this means that if i select J2EE specification level to be EE5.0, i can not set the compiler compliance level to 1.6? Doesn't this mean that practically one can not have an EE application with compliance level of 1.6? This sounds un-natural to me. Is there an explanation for it that i am not aware of? Or am i just hallucinating?
regards,
--mnsharif |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: i see, but...
Posted: Aug 03, 2009 - 11:12 AM
|
|
Moderator


Joined: Aug 21, 2004
Posts: 2512
|
|
mnsharif,
By setting the compliance level to 1.6, Eclipse will allow you to use API/methods that were introduced in 1.6 in your project, this code will only work if executed with a 1.6 VM, you would likely get a NoSuchMethodError if you run it with a 1.5 series VM or it is possible that you get the class version error and the classes will not even load.
Now when it comes to Java EE 5.0, the minimum requirement for a Java EE 5.0 server is a Java 1.5 VM. If you do run your server - say Tomcat with a 1.5 VM and deploy your 1.6 compliant application on it, you could run into the issues described above. This is why we present you with a warning dialog that allows you to change the compliance level. There is nothing wrong with choosing 1.6 as a compliance level, you should ensure you run your server with a 1.6 JDK as well to avoid problems.
Hope this helps. |
_________________ Brian
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Aug 03, 2009 - 12:05 PM
|
|
Joined: Aug 02, 2009
Posts: 12
|
|
Ahan, that's cool.
I will keep my compliance level to 1.6 by ignoring this warning, and will offcourse ensure that i use JDK6 for both development and deployment.
I think, improving the error message in this case would be a great help. Currently it states:
Incompatible Java Compliance Level
Compiler compliance level of project e6 should be 5.0. Your current workspace default is 6.0. Do you want to use a custom setting for your project?
Yes No Cancel
I think, the following alternate would do a better job of explaining the issue when the selected compliance level is _higher_ than the one required by the specifications.
Java Compliance Level Mismatch
Compiler compliance level of project e6 should be 5.0 or higher. Your current workspace default is 6.0. Do you want to use a custom setting for your project?
Yes No Cancel
And a similar message when the selected compliance level is _lower_ than the one required by the specifications.
Incompatible Java Compliance Level
Compiler compliance level of project e6 should be 5.0 or higher. Your current workspace default is 1.3. <A sentence describing the NoSuchMethodError/class version/loading issue in a user friendly manner>. Do you want to use a custom setting for your project?
Yes No Cancel
Thanks for your help once again, guys!
regards,
--mnsharif |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Aug 04, 2009 - 06:05 PM
|
|
Registered Member


Joined: Apr 18, 2007
Posts: 8012
|
|
mnsharif,
Thank you for your feedback. I shall make a note of your request. |
_________________ Nipun
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 22, 2011 - 01:12 AM
|
|

Joined: Apr 18, 2006
Posts: 65
|
|
It's years later and the same annoying, confusing behavior still occurs on MyEclipse 9.1.
We're using version 6 with EE 5. I don't even have a 1.5 jdk on my dev box. I just created a Web Project several times. I select File > New > Web Project. Then, I enter a name, note that the default Java EE 5.0 is still selected, and click Finish. It pops the Incompatible Java Compliance Level box:
Compiler compliance ... should be 5.0. Your ... default is 6.0. Do you want to use a custom setting for your project?
If I click No, the box goes away and my project is created. If I display its properties, the compliance level is set to 1.5, the Use default... box is checked, the shadowed values show 1.5, and there's an alert message about my lack of a 1.5 jdk.
If I click Yes, I get the same results.
There is also a link "Open workspace compiler settings". If I click the link, it shows my workspace settings including (gasp!) compiler compliance 1.6. When I click OK there, that window and the popup both disappear and my project is created. With a compliance level of 1.5. Of course.
The message in the box should be changed. It should be possible to create a Web Project (or other EE project) with the workspace default compliance level. Just in case a user wants a different compliance level for EE projects, there should be a workspace setting for the EE compliance level.
I looked at the Web Project tutorial just to see if this issue was mentioned there. (It isn't.) The tutorial should be updated to show more current pictures, etc. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 25, 2011 - 07:29 AM
|
|
Registered Member


Joined: Feb 03, 2009
Posts: 3442
|
|
|
_________________ Joy
MyEclipse Support
|
| |
|
|
|
 |
|
|