Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.1
-
Fix Version/s: None
-
Labels:None
-
Environment:Windows, Maven 2.0.9
-
Number of attachments :
Description
I'm using an ant task (provided by Weblogic) that generates classes and compiles them with the tools.jar from the JDK.
This task doesn't allow to specify neither source or target version for the compiler.
So, the generated classes are compiled against the currently running JVM, using its rt.jar and the tools.jar provided in plugin dependencies (or placed in the lib/ext directory of the jvm).
As Maven is executed in a 1.5 JVM (1.5 is needed for some modules in my project), these classes are compiled in 1.5.
The server where I want to deploy them is running on a 1.4 JVM, so the generated classes can't run in this server.
I couldn't find a way to tell antrun to compile my classes using a different java version.
I tried the following workarounds :
- change the tools.jar dependency to point to a 1.4 version => as the compiler uses the rt.jar from the currently running 1.5 JVM, the class file version doesn't match (version 49.0, expecting 48.0)
- add a dependency to a 1.4 rt.jar => it doesn't change anything, as the rt.jar should be specified in the boot classpath.
The possible solutions would be :
- allow antrun to fork ant process to a different jvm
- allow antrun to override the boot classpath