ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rose, Angus H" <angus.r...@eds.com>
Subject RE: Setting environment variables
Date Wed, 17 Sep 2003 08:41:58 GMT
Hi Jan, 
      thanks for the reply. I've tried the snippet but it doesn't actually
add the SERVER_HOME to the .cmd script. Is there a way of doing this?

Many thanks

Angus

-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
Sent: 16 September 2003 09:28
To: user@ant.apache.org
Subject: RE: Setting environment variables


Check whether exists

    <!-- access to environment variables -->
    <property environment="env"/>      <!-- 'env' is a common prefix -->

    <!-- check -->
    <fail message="SERVER_HOME not defined" unless="env.SERVER_HOME"/>

Add to startupscript
    
    I think you will start the script via <exec>. Therefore you can use

    <exec executable="cmd.exe">        <!-- your script has suffix .cmd
therefore windows -->
        <arg line="/C thescript.cmd"/>
        <env key="SERVER_HOME" value="c:/path/to/server"/>
    </exec>


Jan




> -----Original Message-----
> From: Rose, Angus H [mailto:angus.rose@eds.com]
> Sent: Tuesday, September 16, 2003 10:22 AM
> To: 'user@ant.apache.org'
> Subject: Setting environment variables
> 
> 
> Hi All,
>         I'm new to Ant and need to know how to do the 
> following: How to
> check to see if an environment variable exists on a user's 
> machine and if
> it's not present, how would I add it to a startup script such as the
> startweblogic.cmd script?
> 
> Thanks in advance
> 
> Angus Rose
> 
> ---------------------------------------------------------------------
> 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