ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Question about validating environment variables and assigning parameters
Date Tue, 16 Dec 2003 07:32:39 GMT
Do you have a

    <property environment="system"/>
    <property name="system.JAVA_HOME" value="--not-set--"/>

before your statements?

The first line gives you access to the environment variables. 
The second sets the system.JAVA_HOME to a default value if there is no
JAVA_HOME in the environment.


Jan


> -----Original Message-----
> From: Baz [mailto:barry@goodconsultants.com]
> Sent: Monday, December 15, 2003 8:31 AM
> To: Ant Users List
> Subject: Question about validating environment variables and assigning
> parameters
> 
> 
> All,
> 
> I am trying to do this:
> 
> <property name="javaBase" value="${system.JAVA_HOME}"/>
> 
> <target name="barry" if="javaBase">
> 
>         <echo message="TEST: JAVA_HOME is ${javaBase}."/>
> 
> </target>
> 
> The problem is, there will always be a value for ${javaBase}. See the
> following output...
> 
> barry:
>      [echo] TEST: JAVA_HOME is ${system.JAVA_HOME}.
> 
> How can I do it properly? Please help.
> 
> Thanks
> 
> Barry
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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