ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: setting a specific compiler
Date Fri, 26 Apr 2002 09:30:46 GMT
> > I would like my project to be compiled using the 1.4 JDK as opposed
> > to our regular 1.3.1 compiler under certain conditions, ideally when
> > a property is set. But from the archives I understand that I can't
> > do this til Ant 1.5.
> Use plain <javac> without forking, set includeantruntime and
> includejavaruntime to false, add tools.jar and rt.jar of JDK 1.4 to
> the classpath (or even bootclasspath).  I think this should work in
> Ant 1.4.1.

Thanks for that Stefan, although I appear to be doing something wrong still. One thing I find
confusing about particularly the <javac> task is that legal values for the attributes
aren't listed in the manual. You mention set includejavaruntime to false, but the docs indicate
that the value shd be "no". For other options it's either yes/no, on/off or true/false, and
I don't know how to be told whether i have an option wrong.

Anyway does this seem correct? It's not working... I've tried putting the tools.jar on both
cp and bcp, also tried forking on and off.

  <target name="compileAlternateJDK" depends="init" if="javac.AlternateJDK">
    <!-- Compile the java code from ${src} into ${build} -->
        <pathelement path="${javac.AlternateJDK}/lib/tools.jar"/>
        <pathelement path="${javac.AlternateJDK}/lib/rt.jar"/>
      <classpath refid="classpath"/>

Visit our website at

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.

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

View raw message