Hi Antonio,
I am just trying to understand what is done in EclipseJavaCompiler ;)

Original code: if we have the compiler-compliance-level parameter set to 1.5, 
then the JDT options org.eclipse.jdt.core.compiler.compliance and 
org.eclipse.jdt.core.compiler.source are set to 1.5. Then 
SystemUtils.JAVA_VERSION_INT is used to set the JDT option 
org.eclipse.jdt.core.compiler.codegen.targetPlatform.

So if I use a 1.6 JVM and if I set compiler-compliance-level to 1.5 (maximum 
handled by JDT 3.1) then I end up with the following combination out of 
EclipseJavaCompiler:
- compliance = 1.5
- source = 1.5
- targetPlatform = 1.3

It is true that this combination is discouraged in the Eclipse Preferences 
panel. It requires that Source compatibility <= Classfile compatibility 
(targetPlatform) <= Compliance level.

But with my "wrong" configuration I get no errors from JDT and XSPs are 
compiled and are running correctly (which is "understandable" because my target 
platform is a 1.6, so the minimum level of 1.3 is respected).

Anyway I think that EclipseJavaCompiler should be modified to properly handle 
1.6 without reverting to 1.3 by default (even if the 2 additional jdt 
properties look more cosmetic than critical for the generated code).

Laurent

-----Original Message-----
From: Antonio Gallardo [mailto:agalla...@agssa.net] 
Sent: vendredi, 28. août 2009 17:51
To: users@cocoon.apache.org
Subject: Re: Cocoon 2.1.11- XSP compiled in Java 1.3 when running Cocoon with a 
1.6 JVM and using the Eclipse compiler

Hi Laurent,

Hmm. I am wondering about your message, because IIRC, the compliance 
level almost define the target java version for compiled class. I mean 
if I select compliance level 1.5, the generated class cannot be compiled 
for java 1.3 because 1.3 JVM cannot handle some of the new features 
introduced in java 1.5. I can be wrong be I can recall it is not 
possible to set that way in eclipse. I mean a higher compliance level 
(ie: 1.5) and a lower compilation level (ie: 1.3). It simply does not work.

Best Regards,

Antonio Gallardo.


____________________________________________________________

� This email and any files transmitted with it are CONFIDENTIAL and intended
  solely for the use of the individual or entity to which they are addressed.
� Any unauthorized copying, disclosure, or distribution of the material within
  this email is strictly forbidden.
� Any views or opinions presented within this e-mail are solely those of the
  author and do not necessarily represent those of Odyssey Financial
Technologies SA unless otherwise specifically stated.
� An electronic message is not binding on its sender. Any message referring to
  a binding engagement must be confirmed in writing and duly signed.
� If you have received this email in error, please notify the sender immediately
  and delete the original.

Reply via email to