You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Eric Wood <ew...@llbean.com> on 2004/01/07 14:00:03 UTC

using javac to buils classes files to run under java 1.2.2

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


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


Re: using javac to buils classes files to run under java 1.2.2

Posted by Antoine Lévy-Lambert <an...@antbuild.com>.
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