ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Re: Re: Settting environment variables
Date Wed, 09 May 2007 13:54:42 GMT
You cant set env variables in <exec>.
<exec> start a new process. Env variables are only visible in that process.
If that process quits the variables are lost.

You cant modify the environment of the running (Ant) process.


Jan 



p.s.
You have the same problem with batch files. There is a tool "setx" which
can set environment variables on system level. Maybe you could set
env vars for Ants NEXT run. (setx doesnt change current running processes).




>-----Urspr√ľngliche Nachricht-----
>Von: Martin Gainty [mailto:mgainty@hotmail.com] 
>Gesendet: Mittwoch, 9. Mai 2007 15:32
>An: Ant Users List; query
>Betreff: Re: Re: Re: Settting environment variables
>
>using embedded env
>  <env key="PATH" path="${env.PATH}:${basedir}/bin"/>
>
>use in property
> <property environment="env"/>
>  <echo message="INCLUDE = ${env.INCLUDE}"/>
>  <echo message="PATH is set to = ${env.PATH}"/>
>
>note..the env variable is case-sensitive 
>so path is not Path is not PATH
>M--
>This email message and any files transmitted with it contain 
>confidential
>information intended only for the person(s) to whom this email 
>message is
>addressed.  If you have received this email message in error, 
>please notify
>the sender immediately by telephone or email and destroy the original
>message without making a copy.  Thank you.
>
>  ----- Original Message ----- 
>  From: query 
>  To: ant 
>  Sent: Wednesday, May 09, 2007 5:37 AM
>  Subject: Fwd: Re: Re: Settting environment variables
>
>
>   
>  I again tried to set PATH and INCLUDE env variables. But 
>when I echo the env variables after modifying the variables, 
>changes are not reflected in the log file.
>  My ANT script change is:
>  property environment="env"/>
>  <exec executable="cmd">
>        <env key="include" path="${new.includepath}"/>
>  </exec>
>  <echo message ="include=${env.include}"/>
>
>  Similarly I have tried for Path env variable. But it is not working.
>
>  If there is any other way to set variables, please let me 
>know. Due to this issue, it is hampering my work.........
>
>
>  Note: Forwarded message attached
>
>  -- Original Message --
>
>  From: Ninju Bohra <ninju_bohra@yahoo.com>
>  To: Ant Users List <user@ant.apache.org>
>  Subject: Re: Re: Settting environment variables
>
>
>
>
>       
>
>
>
>---------------------------------------------------------------
>---------------
>
>
>  ---------------------------------------------------------------------
>  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