You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Issam Aib <ia...@bbcr.uwaterloo.ca> on 2006/02/12 22:42:54 UTC

How to get the value of a system's environment variable

Hi folks,

 

I would like to get the value of some system environment variables, such as TOMCAT_HOME, PATH, CVSROOT, etc, as a property inside my ant script.

 

Can anyone help?

 

Thanks,

Issam Aib


RE: How to get the value of a system's environment variable

Posted by Issam Aib <ia...@bbcr.uwaterloo.ca>.
Thanks Jeffrey,

> -----Original Message-----
> From: Jeffrey E Care [mailto:carej@us.ibm.com]
> Sent: February 12, 2006 4:57 PM
> To: Ant Users List
> Subject: Re: How to get the value of a system's environment variable
> 
> Read the manual for the <property> task.
> 
> > I would like to get the value of some system environment variables,
> > such as TOMCAT_HOME, PATH, CVSROOT, etc, as a property inside my ant
> script.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: How to get the value of a system's environment variable

Posted by Jeffrey E Care <ca...@us.ibm.com>.
Read the manual for the <property> task.

> I would like to get the value of some system environment variables, 
> such as TOMCAT_HOME, PATH, CVSROOT, etc, as a property inside my ant 
script.

RE: How to get the value of a system's environment variable

Posted by Issam Aib <ia...@bbcr.uwaterloo.ca>.
Well,

I found the answer on the web:

You can access environment variables within Ant using:

<property environment="env"/>

This provides all environment variables as Ant properties prefixed by "env.". For example, CLASSPATH would be accessible in Ant as ${env.CLASSPATH}.
Help Source: http://www.java-tips.org/content/view/740/29/


Thanks anyway,

Issam Aib

> -----Original Message-----
> From: Issam Aib [mailto:iaib@bbcr.uwaterloo.ca]
> Sent: February 12, 2006 4:43 PM
> To: 'Ant Users List'
> Subject: How to get the value of a system's environment variable
> 
> Hi folks,
> 
> 
> 
> I would like to get the value of some system environment variables, such
> as TOMCAT_HOME, PATH, CVSROOT, etc, as a property inside my ant script.
> 
> 
> 
> Can anyone help?
> 
> 
> 
> Thanks,
> 
> Issam Aib



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org