You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Perry Hunchak <ph...@palmtreebusiness.com> on 2001/05/03 16:27:28 UTC
Using System Environment variables
Is there any way to use the system environment variables (for windows)
in the build.xml file ant uses?
I currently use specify my tomcat home by pointing to the file system
path
example:
<property name="tomcat.home" value="d:/java/tomcat3.2.1"/>
But I'd like to just use the system environment variable so I could use
this on different servers
example:
<property name="tomcat.home" value="Tomcat_Home"/>
Is there any way to do this?
Re: Using System Environment variables
Posted by Stephen Graham <sg...@bigpond.com>.
You could also write your own task to read the environemt variables you.
Regards
Stephen Graham.
----- Original Message -----
From: "Perry Hunchak" <ph...@palmtreebusiness.com>
To: <an...@jakarta.apache.org>
Sent: Friday, May 04, 2001 12:27 AM
Subject: Using System Environment variables
Is there any way to use the system environment variables (for windows)
in the build.xml file ant uses?
I currently use specify my tomcat home by pointing to the file system
path
example:
<property name="tomcat.home" value="d:/java/tomcat3.2.1"/>
But I'd like to just use the system environment variable so I could use
this on different servers
example:
<property name="tomcat.home" value="Tomcat_Home"/>
Is there any way to do this?
Re: Using System Environment variables
Posted by Fabian Mörchen <Fa...@math.uni-giessen.de>.
hi
haven't tried on win, but this work on linux:
<property environment="env"/>
${env.JAVA_HOME}
bye
fabian
Perry Hunchak wrote:
>
> Is there any way to use the system environment variables (for windows)
> in the build.xml file ant uses?
>
> I currently use specify my tomcat home by pointing to the file system
> path
>
> example:
> <property name="tomcat.home" value="d:/java/tomcat3.2.1"/>
>
> But I'd like to just use the system environment variable so I could use
> this on different servers
>
> example:
> <property name="tomcat.home" value="Tomcat_Home"/>
>
> Is there any way to do this?
--
Fabian Mörchen
fabian@mybytes.de
http://www.mybytes.de
Re: Using System Environment variables
Posted by Jim Downing <ji...@pobox.com>.
Perry,
use <property environment="env"/>
then env.Tomcat_Home.
jim
----- Original Message -----
From: "Perry Hunchak" <ph...@palmtreebusiness.com>
To: <an...@jakarta.apache.org>
Sent: Thursday, May 03, 2001 3:27 PM
Subject: Using System Environment variables
Is there any way to use the system environment variables (for windows)
in the build.xml file ant uses?
I currently use specify my tomcat home by pointing to the file system
path
example:
<property name="tomcat.home" value="d:/java/tomcat3.2.1"/>
But I'd like to just use the system environment variable so I could use
this on different servers
example:
<property name="tomcat.home" value="Tomcat_Home"/>
Is there any way to do this?
Re: Using System Environment variables
Posted by Nico Seessle <ni...@apache.org>.
----- Original Message -----
From: "Stephen Graham" <sg...@bigpond.com>
To: <an...@jakarta.apache.org>
Sent: Monday, May 07, 2001 10:10 AM
Subject: Re: Using System Environment variables
> The most common way of doing this is to pass the environment variables in
on
> the command line, using the '-D' option.
>
> I don't know any other way of getting access to environment variables from
> within the build script.
>
<property environment="env"/>
will give you a property named "env.TOMCAT_HOME" for the environment
variable "TOMCAT_HOME". It can then be referenced using ${env.TOMCAT_HOME}.
Nico
Re: Using System Environment variables
Posted by Stephen Graham <sg...@bigpond.com>.
The most common way of doing this is to pass the environment variables in on
the command line, using the '-D' option.
I don't know any other way of getting access to environment variables from
within the build script.
Regards
Stephen Graham.
----- Original Message -----
From: "Perry Hunchak" <ph...@palmtreebusiness.com>
To: <an...@jakarta.apache.org>
Sent: Friday, May 04, 2001 12:27 AM
Subject: Using System Environment variables
Is there any way to use the system environment variables (for windows)
in the build.xml file ant uses?
I currently use specify my tomcat home by pointing to the file system
path
example:
<property name="tomcat.home" value="d:/java/tomcat3.2.1"/>
But I'd like to just use the system environment variable so I could use
this on different servers
example:
<property name="tomcat.home" value="Tomcat_Home"/>
Is there any way to do this?