ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Abley <>
Subject RE: Building Java code with a different version
Date Wed, 09 Mar 2005 08:12:44 GMT
On Wed, 2005-03-09 at 04:43, Perkins, Kristian wrote:
> I think the point to make is that the same JDK will be used regardless
> of the values of build.compiler or compiler attribute, but the
> difference will be in the compiled classes that are outputted, that is
> setting compiler to javac1.4 will generate class files compatible with
> java version 1.4 and later.  If you want to compile your code under a
> different JDK than the $JAVA_HOME JDK then set fork="true" and set the
> executable attribute to where ever the executable is of the external
> java compiler is.

As per the example in the manual:

"If you want to run the javac compiler of a different JDK, you should
tell Ant, where to find the compiler and which version of JDK you will
be using so it can choose the correct command line switches. The
following example executes a JDK 1.1 javac in a new process and uses the
correct command line switches even when Ant is running in a Java VM of a
different version:

  <javac srcdir="${src}"


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message