ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: reading system variables?
Date Wed, 15 Nov 2000 09:07:57 GMT
Hadi Abedi <> wrote:

> So Should I assume that any arbitrary system variables that I
> define, like MYPATH, I must pass it in as arguments to Ant?

Yes it is. Java doesn't provide access to environment variables, so
you need to translate them into something Java knows, i.e. properties.

> How about if I am running it on a UNIX platform, do I still use
> -DOS?

Cyril gave an example -Dos.path=$PATH that defined a property os.path,
the general syntax is -DPROPERTYNAME=PROPERTYVALUE - on any Java

> Also, is there a list of predefined properties for Ant?

The online version of the Ant manual has a section labeled "Built in
Properties" short after

In addition to these there is ant.home which points to the directory
where Ant has been installed if and only if you use the starter script
named ant or ant.bat.

Furthermore Ant gives you access to all System properties, please
refer to the JDK API documentation on the System class to get a list
of the predefined ones (usually there are more than the ones listed

If you invoke ant -debug, you can see a bunch of lines reading
something like

Setting project property: java.vm.vendor -> IBM Corporation

this will give you a list of everything that has been defined.


View raw message