Specify JRockit or JDK to Maven

675 views Asked by At

I'd like to know how to specify the path of JRockit libraries to Maven to use , same as we do for eclipse when you specify the JRE .

Also how do i configure maven to use Sun JDK in a project and use JRockit in another project ?

Thanks

1

There are 1 answers

0
Mark O'Connor On BEST ANSWER

A number of options available:

  1. Maven uses the JAVA_HOME environment variable to determine which JVM should run Maven (Maven is itself a Java program). I recommend this as the first option because build servers like Jenkins can easily control the JVM being used to run Maven.

  2. You can tweak the settings of the compiler plugin to compile using a different JDK

  3. An alternative approach (clearer to others running your build) would be to build in a pre-condition check into the POM, using the enforcer plug-in. Specify a rule that the it should be compiled using a specified Java version.