ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <anto...@antbuild.com>
Subject Re: using javac to buils classes files to run under java 1.2.2
Date Wed, 07 Jan 2004 13:40:21 GMT
Eric Wood wrote:

>I'm confused by the use of the compiler and target attributes for the javac task.  I'm
running ant using java 1.4.1 but need to compile my classes to run under java 1.2.2. Do I
only have to use the compiler="classic" attribute or do I have to use target="1.2" as well?
>
>Can somebody please clarify?
>
>
>Eric Wood
>ewood@llbean.com
>207.552.2306
>
>
>
>  
>
Hi Eric,

if you want to compile using a compiler which is not the one of the VM 
in which ant is running, you need to use the fork="true" attribute and 
set the executable attribute to point to the location of the javac.exe 
you want to use, for instance executable="c:/jdk1.2.2/bin/javac.exe".

Note that as long that you are not using routines which are only 
available in 1.3 or later, you can compile your java sources under java 
1.4.1 and run your application under 1.2.2.

Cheers,

Antoine

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message