ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rez P <pon...@hotmail.com>
Subject RE: Building with JDK 1.3. Which version of ANT?
Date Thu, 30 Jul 2009 04:56:12 GMT

Thanks for the quick response Stefan.  That's the part I couldn't understand!  I did set my
java_home to jdk 1.3! And added %java_home%\bin to my windows path variable.  I believe where
Ant error msg is coming from is my java consol control panel pointing to jre 1.3 as I had
unchecked and disabled the jre 1.5 temporarily.

 

I just got a successful build by using jdk 1.5, ant 1.7, and setting source & target attributes
of the javac ant task to 1.3.  Do you see any problem with this configuration as far as jdk
1.5 adding unwanted stuff to my generated class files as opposed to, if I set my entire environment
to jdk 1.3 and making sure that the old project doesn't become polluted with any new tools
or libraries?

 

Thanks

 

Rez

 


 
> To: user@ant.apache.org
> Subject: Re: Building with JDK 1.3. Which version of ANT?
> From: bodewig@apache.org
> Date: Thu, 30 Jul 2009 06:35:20 +0200
> 
> On 2009-07-30, Rez P <pons32@hotmail.com> 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.
> 
> > BUILD FAILED
> > 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.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

_________________________________________________________________
NEW mobile Hotmail. Optimized for YOUR phone.  Click here.
http://windowslive.com/Mobile?ocid=TXT_TAGLM_WL_CS_MB_new_hotmail_072009
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message