Thanks Diane!
The "fork" attribute worked.

The documentation in the ant manual for "fork" is so obscure
I never tried that option. The thought was that what benefit I'll derive
in making the java task run in another VM. I still do not
understand how/why it works now.

-Gurdev

----- Original Message -----
From: "Diane Holt" <[EMAIL PROTECTED]>
To: "Ant Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, January 29, 2002 5:28 PM
Subject: Re: java task


> --- Gurdev Parmar <[EMAIL PROTECTED]> wrote:
> > Is this how you would translate the below given java command to an
> > equivalent java task?
> >
> > java command:
> > ${JDK_HOME}/bin/java -Dproject.home=${PROJ_HOME} -classpath ${CP}
> > project.Classname -keepgenerated -compiler ${JDK_HOME}/bin/javac
> > -classpath
> > ${OUT_DIR};${CP} ${OUT_DIR}/project.jar ${PROJECT_DIR}
> >
> > <java classname="project.Classname">
> >   <arg line=" -keepgenerated -compiler ${JDK_HOME}/bin/javac -classpath
> > ${OUT_DIR}:${CP} ${OUT_DIR}/project.jar ${PROJECT_DIR}" />
> >   <classpath>
> >     <pathelement path="${CP}"/>
> >   </classpath>
> >   <jvmarg value="-Dproject.home=${PROJ_HOME}"/>
> >  </java>
>
> Close, but not exactly. If your references to things like ${PROJ_HOME},
> etc. are to environment variables, you need to read them in first, and
> they'll be prefixed (with whatever prefix you choose) -- eg:
>   <property environment="env"/>
> will read in your env vars and prefix them with "env." -- then you
> reference them as, eg., ${env.PROJ_HOME}.
>
> Also, in order to use <jvmarg>, you need to specify fork="true" (or "yes"
> or "on"). And you'll need to include the "-classpath ${env.CP}" in the
> <jvmarg> in order for it to be used as the classpath for the forked java
> process.
>
> Diane
>
> =====
> ([EMAIL PROTECTED])
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions!
> http://auctions.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to