ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wim Praet" <>
Subject Ant 1.6.3, JDK1.5 and extJavac="1.3"
Date Mon, 02 May 2005 15:13:49 GMT

does Ant 1.6.3 have a problem with the javac task when specifying an 
external java compiler to use, in combination with JDK1.5 as your default 
installed JDK?
Following target worked for me on my system with JDK1.5.0_02 as default JDK 
installed (and my JAVA_HOME pointing to the JDK1.5 install dir) and Ant 
1.6.2 (and before):

<javac srcdir="${src}" destdir="${build}" debug="${debug}" 
compiler="extJavac" executable="${jdk13}" source="1.3" target="1.3">

(where ${jdk13} points to the JDK1.3 javac executable).

Running this with Ant 1.6.3 results in the following message: (I echoed the 
JAVA_HOME and the ${jdk13} vars):

     [echo] JAVA_HOME set to c:\java\j2sdk1.5.0_02\jre
     [echo] Using C:\java\jdk1.3.1_02\bin\javac.exe
    [javac] Compiling 455 source files to C:\projects\test\build
    [javac] javac: invalid flag: -source
    [javac] Usage: javac <options> <source files>
     <snip> (just more javac options stuff).

Setting the "java.home" property is of no use as it is read only for Ant, 
and setting the "build.compiler" to use a default JDK1.4 javac compiler 
didn't work either. Setting my JAVA_HOME env variable to the JDK1.4 install 
dir _does_ work and compiles my sources without a hassle).

However, my guess is that I should not have to set my JAVA_HOME variable if 
I want to compile something targetted at an older JDK than the one I have 
currently installed as the default one? It's also a fact that it does not 
compile anymore since I installed ant 1.6.3 ...

Wim Praet.

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

View raw message