MyEclipse: Java Compliance Level

hahagal - May 30, 2012 - 10:51 AM
Post subject: Java Compliance Level
Hi,

I tried to create a JavaEE 5.0 enterprise project and I get this prompt "Compiler compliance level of project should be 5.0. Your current workspace default is 6.0. Do you want to use a custom setting for your project?" My workspace default is set to 1.6. How should I proceed?

Using MEB 10 and WebSphere 7.0
support-swapna - May 30, 2012 - 11:22 AM
Post subject:
hahagal,

You can either click "Yes" or "No" depending on the compliance level you want. If you choose "Yes" the compliance level will be 5.0 else it will default to 6.0. You can change the compliance level of your project from its properties.
Right click on your project and go to properties > Java Compiler and set " Compiler Compliance Level".

Please refer to the following links also for further reference -
1. http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&t=25121
2. http://www.myeclipseide.com/index.php?name=PNphpBB2&file=viewtopic&t=24116

Hope this helps.
hahagal - May 30, 2012 - 06:08 PM
Post subject:
Hi swapna,

A little confuse here....

WebSphere 7 is using JDK 1.6. And if I select Yes for the prompt, it create the projects with 1.5. When I Right click on your project and go to properties > Java Compiler, I saw this warning "When selecting 1.5 compliance, make sure to have a compatible JRE installed and activated (currently 1.6)...."

1) Am I correct to say WebSphere 7 is using JDK 1.6. If I am using WebSphere 7 for JavaEE 5.0 project, my compiler compliance level should be 1.6?

2) Is there any links between compiler compliance level and installed JREs?
support-swapna - Jun 01, 2012 - 09:55 AM
Post subject:
hahagal,

You can still deploy a Java EE 5.0 project to WAS 7.

For more detailed understanding of Installed JREs and Compiler Compliance level, please take a look at this link:
http://www.coderanch.com/t/531065/vc/Difference-between-Installed-JREs-Compiler

Hope this helps.
support-tony - Jun 05, 2012 - 12:02 PM
Post subject:
hahagal,

To expand on what Swapna wrote, the JRE level and the Jave EE level are independent, to a degree. It is the JRE level that you are getting a warning dialog for. For example, you can use Java EE 5, with a 1.6 JRE, no problem.

You're right, Websphere 7 uses a 1.6 JDK (which has a 1.6 JRE). But you don't necessarily need 1.6 compliance for your project. That's up to you.
support-piotr - Jun 06, 2012 - 02:45 PM
Post subject:
hahagal,

There is ambiguity in Java Compliance level numbering. At some point in the past (after Java 1.4) Sun (now Oracle) decided to name next Java version 5.0. However, technically it was still Java 1.5. Thus Java 1.5 = Java 5.0, Java 1.6 = Java 6.0 and Java 1.7 = Java 7.0
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits