ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Donald Strong" <dstr...@agentissoftware.com>
Subject RE: Switching JDK
Date Mon, 11 Oct 2004 01:04:22 GMT
We use the following ant code to change JDK and Ant versions.
Our cruisecontrol uses JDK 1.4.1 and Ant 1.5.1.
Our latest build uses JDK 1.4.2 and Ant 1.6.1.

Regards Donald.

   ... snip
        <echo>cc-build.xml: ${ant.version}</echo>
        <echo>Java version: ${java.version}</echo>

        <property name="agentis.java.home"
              location="${tools.dir}/windows/${JDK_VERSION}" />

        <path id="jdk.class.path">
            <pathelement
location="${tools.windows.jdk.home}/jre/lib/rt.jar"/>
            <pathelement location="${tools.windows.jdk.home}/jre/lib" />
            <pathelement
location="${tools.windows.jdk.home}/lib/tools.jar"/>
        </path>
        <path id="ant.class.path">
            <path refid="jdk.class.path" />
            <fileset dir="${tools.ant.home}/lib">
                <include name="*.jar"/>
            </fileset>
       </path>
   ... snip

    <target name="-ant-task" depends="-init, -check-ant-task-properties">
        <java classname="org.apache.tools.ant.Main"
                    dir="${antexec.dir}"
                   fork="true"
            failonerror="true"
                timeout="6000000"
              maxmemory="512m"> <!-- 6000000 ms = 100 minutes -->
            <classpath refid="ant.class.path" />
            <arg line="${antexec.buildfile.arg}" />
            <arg line="${antexec.properties}" />
            <arg line="${antexec.targets}" />
            <sysproperty key="java.home" value="${agentis.java.home}" />
        </java>
    </target>

> -----Original Message-----
> From: Roberto Juarez [mailto:rjuarez@omnilogic.es]
> Sent: Friday, 8 October 2004 11:37 PM
> To: Ant Users List
> Subject: RE: Switching JDK
>
>
> Mmmm, there is a fast possibility, though it sounds a little like
> brute force. You could try it in case you have little time.
>
> In your build.xml which is being called by the automated build
> process, use a <java> task to launch a virtual machine with the
> JDK you may need. Use this <java> task to launch another runnin
> Ant that process your actual targets.
>
> I know it is somehow involved but can save you if you are in a hurry.
>
> Cheers,
>
> Roberto.
>
> > -----Mensaje original-----
> > De:	Barnes, Michael [SMTP:MBarnes@tiaa-cref.org]
> > Enviado el:	viernes, 08 de octubre de 2004 15:23
> > Para:	'Ant Users List'
> > Asunto:	RE: Switching JDK
> >
> > I thought about that. But my problem is that this is being
> called from an
> > automated build process which is managaging several ant scripts.
> >
> > Mike
> >
> > -----Original Message-----
> > From: Roberto Juarez [mailto:rjuarez@omnilogic.es]
> > Sent: Friday, October 08, 2004 9:21 AM
> > To: Ant Users List
> > Subject: RE: Switching JDK
> >
> >
> > You could try to change the JAVA_HOME environment variable via a shell
> > script.
> >
> > Cheers.
> >
> > > -----Mensaje original-----
> > > De:	Barnes, Michael [SMTP:MBarnes@tiaa-cref.org]
> > > Enviado el:	viernes, 08 de octubre de 2004 15:14
> > > Para:	'user@ant.apache.org'
> > > Asunto:	Switching JDK
> > >
> > > I have 2 JDK's on my system. I need to get ant to use the
> appropriate JDK
> > > and can not figure out how to do this as well as verifying that ant is
> > using
> > > the appropriate JDK. BTW, I am running ANT 1.6.1
> > >
> > > Thanks
> > >
> > >
> > > **************************************************************
> > > This message, including any attachments, contains
> confidential information
> > intended for a specific individual and purpose, and is
> protected by law.  If
> > you are not the intended recipient, please contact sender immediately by
> > reply e-mail and destroy all copies.  You are hereby notified that any
> > disclosure, copying, or distribution of this message, or the
> taking of any
> > action based on it, is strictly prohibited.
> > > TIAA-CREF
> > > **************************************************************
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: user-help@ant.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> > **************************************************************
> > This message, including any attachments, contains confidential
> information intended for a specific individual and purpose, and
> is protected by law.  If you are not the intended recipient,
> please contact sender immediately by reply e-mail and destroy all
> copies.  You are hereby notified that any disclosure, copying, or
> distribution of this message, or the taking of any action based
> on it, is strictly prohibited.
> > TIAA-CREF
> > **************************************************************
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


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


Mime
View raw message