ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Curran <s.cur...@aepona.com>
Subject Re: Ant 1.4.1: Using javac fork=true and changing java.home
Date Fri, 19 Apr 2002 09:00:01 GMT
Yeah, I had this problem the other day and these guys helped me to resolve it...

This is the solution that they came up with.  I was compiling all my java source with java
1.3 but wanted to build my javadocs using
java 1.4....

<target name="buildJavadoc" depends="initCommon" >

        <!-- Build the javadoc in a seperate ant process so that we can use version 1.4
of the javadoc utility -->
        <exec executable="ant">
            <arg line="-buildfile ${ant.file} javadocCreate"/>
            <env key="JAVA_HOME" value="${java_home1.4}"/>
        </exec>

        <echo message="Reverting back to Java ${ant.java.version} for remainder of build..."/>

</target>

<target name="javadocCreate" depends="retrieveFileNamesForJavadoc" >

        <javadoc sourcepath="${pcp_source_dir}:${parlay_src}:${parlay_rel4_src}"
            classpath="${sdk_jar_file}:${corba_classpath_stuff}"
            packageList="${working_directory}/tmpJavadocInput2"
            ....
            ....


Simon.

Stefan Bodewig wrote:

> On Thu, 18 Apr 2002, Gordon Tyler <gordon.tyler@sitraka.com> wrote:
>
> > However, it seems that <javac fork=true> doesn't use the java.home
> > property to execute javac.
>
> Correct.
>
> Ant 1.5alpha has a new attribute in <javac> that lets you explicitly
> point Ant to the compiler you want to use.
>
> For 1.4.1 you can either <exec> a new instance of Ant like Diane
> suggests or set includejavaruntime and includeantruntime to false, add
> tools.jar of JDK 1.4.1 to <javac>'s <classpath> and don't use fork.
>
> Stefan
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--

***************************************************************
* Simon Curran              * Email : simon.curran@aepona.com *
* Software Engineer         * WWW   : www.aepona.com          *
* Aepona Ltd.               * Phone : +44 (0)28 9027 5231     *
* Interpoint Building,      * Fax   : +44 (0)28 9026 9111     *
* 20-24 York Street,        *                                 *
* Belfast. BT15 1AQ.        *                                 *
* N. Ireland.               *                                 *
***************************************************************



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message