Thanks for that Gordon - thing is that is what I tried at first and it didn't work for 
me, it was finding the new rt.jar but not running the 1.4 compiler (ant was running in 
a 1.3 VM).  However I didn't have any of the extdirs, source or target attributes set, 
but I don't think that would be the difference?

I do have it working now but it seems a bit hacky... 

thx, jamie

> -----Original Message-----
> From: Gordon Tyler [mailto:[EMAIL PROTECTED]]
> Sent: 26 April 2002 16:14
> To: Ant Users List
> Subject: Re: setting a specific compiler
> 
> 
> Hi Jamie,
> 
> I've gone through the same sort of hassle recently and this 
> is the solution
> that I came up with based on a suggestion from Stefan Bodewig:
> 
> Our main build environment is JDK 1.4 but there are parts of 
> the system that
> must be compiled with JDK 1.3. So Ant is executed using JDK 
> 1.4 and uses the
> cross compiling options when compiling the 1.3 classes. This 
> is what some of
> our build file looks like:
> 
>   <target name="compile-java-1.3">
>     <javac debug="yes"
>         deprecation="yes"
>         includeantruntime="false"
>         includejavaruntime="false"
>         target="1.2"
>         source="1.3"
>         extdirs="${java13.home}/jre/lib/ext"
>         destdir="${build}"
>         srcdir="${src}">
>       <bootclasspath>
>         <pathelement location="${java13.home}/jre/lib/rt.jar"/>
>       </bootclasspath>
>       <classpath refid="alto.classpath"/>
>       <include name="${alto.package}/agent/**/*.java"/>
>       <include name="${alto.package}/common/**/*.java"/>
>       <exclude
> name="${alto.package}/common/communication/generator/*.java"/>
>       <exclude name="${alto.test.dir}/*.java"/>
>     </javac>
>   </target>
> 
>   <target name="compile-java-1.4">
>     <javac debug="yes"
>         deprecation="yes"
>         destdir="${build}"
>         srcdir="${src}"
>         target="1.4"
>         source="1.4">
>       <classpath refid="alto.classpath"/>
>       <include name="${alto.package}/client/**/*.java"/>
>       <include name="${alto.package}/commonui/**/*.java"/>
>       <include name="${alto.package}/nexus/**/*.java"/>
>       <include name="${alto.package}/workstation/**/*.java"/>
>       <exclude name="${alto.test.dir}/*.java"/>
>     </javac>
>   </target>
> 
> Where java13.home is a property defined to point to the JDK 
> 1.3 directory.
> 
> Of course we have to make sure that that none of the 1.3 
> compiled classes
> refer to 1.4 compiled classes since it dies with the 
> incorrect class version
> error.
> 
> Ciao,
> Gordon
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


Visit our website at http://www.ubswarburg.com

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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to