ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Mégnin <cha...@theblueplanet.org>
Subject Re: environment variable
Date Sun, 12 Aug 2001 03:09:21 GMT
Thanks Erik but the source of my confusion is with
using an environment variable in a build such as:

<property environment="env"/>

(...)

<target name="build" depends="init">
    <mkdir dir="${java.build}"/>
    <javac srcdir="${java.source}" destdir="${java.build}">
    </javac>
 </target>

How do I include say ${env.JAVA_HOME}  in the target ?
Charles


Erik Hatcher wrote:

> >From http://www.jguru.com/forums/view.jsp?EID=474002 :
>
> <property environment="env"/>
>
> provides all environment variables as Ant properties prefixed by "env.". For
> example, CLASSPATH would be accessible in Ant as ${env.CLASSPATH}.
>
> Although using CLASSPATH is just illustrative, since you could use
> ${java.class.path} instead - but the same example applies for any other
> environment variables you wish to access.
>
>     Erik
>
> ----- Original Message -----
> From: "Charles Mégnin" <charly@theblueplanet.org>
> To: <ant-user@jakarta.apache.org>
> Sent: Saturday, August 11, 2001 7:33 PM
> Subject: environment variable
>
> > Would someone have an example of how an environment
> > variable is used in a build ? I can't seem to make any sense
> > of the doc on property. Thanks in advance.
> > Charles
> >


Mime
View raw message