ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Building with JDK 1.3. Which version of ANT?
Date Thu, 30 Jul 2009 04:35:20 GMT
On 2009-07-30, Rez P <> wrote:

> I'm going back in time and have to compile and old java project with
> JDK 1.3.  Currently I'm using Ant 1.7 and JDK 1.5 for all my
> projects. So when I wrote a build.xml for the jdk 1.3 code and in
> the compile target, using javac ant task, and set the 'source' or
> 'target' attributes to 1.3, I got errors that were not very clear to
> me, something like switch back to...  Does this mean I am using the
> wrong version of Ant and have to switch to 1.6 or earlier versions?

No, not at all.  1.7 should work with JDK 1.3, 1.8.0 won't.

>     [javac] Compiling 220 source files to C:\Temp\old_project\build\WEB-INF\classes
>     [javac] Modern compiler not found - looking for classic compiler

This means Ant tried to look up javac's main class of the compiler
that was once the modern compiler - this is javac of JDK 1.2 IIRC,
could be 1.3 as well - and failed.

classic in contrast is the main class of the javac version of JDK 1.1.

If Ant cannot find the modern compiler on JDK 1.3 it means it either
failed to load tools.jar or you are not using a Sun JDK.

> C:\Temp\old_project\build.xml:66: Cannot use classic compiler , as it is not available.
>  A common solution is to set the environment variable JAVA_HOME to your jdk directory.
> It is currently set to "C:\Progra~1\java\jdk1.3.1_20\jre"

And here is your problem.  Ant needs a JDK, not a JRE.  Set JAVA_HOME
to C:\Progra~1\java\jdk1.3.1_20 instead and Ant should be able to
locate tools.jar.


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

View raw message