You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "O'Hara, Patrick" <pa...@workscape.com> on 2001/08/09 15:43:31 UTC

What properties are available

I have a build script that I have been using on Windows NT.  It uses the
environment to get the values of JAVA_HOME and ANT_HOME.  I use these values
to build my class path.  I have found that the environment is not available
on Win2K.  I am wondering if these values are available as properties within
Ant.  It seems to me that Java/Ant must know these values at some level.
The more general question is how can I get a list of the properties that are
available?

Patrick O'Hara
Workscape, Inc
N17 W24222 Riverwood Pl
Waukesha, WI 53188-1162
262-408-3849
262-408-3840 Fax
patrick.ohara@workscape.com


Re: What properties are available

Posted by Michael Leo <ml...@cariboulake.com>.
Actually, they are available within ANT, at least on Solaris:

   <property environment = "mysys"/>

will give you access to all the operating systems environment
variables (if your OS has them ;-) via

    ${mysys.PATH}

or whatever.

Hope this helps,

Cheers,

Mike Leo

At 10:21 AM 8/9/2001 -0400, Matthew Inger wrote:
>Environment variables are a non standard way of doing things
>with java.  The reason they are not readily available is that they
>do not exist on all platforms (here is where I cough, and point
>fingers at MacOs before version X).
>
>Therefore, they're not available.  the way  you have to make them
>available is by passing them on the command line as System properties:
>
>java -Dmy.var=${MY_VAR} test.class
>
>
>
>Stefan Bodewig wrote:
>
>>On Thu, 9 Aug 2001, Patrick O'Hara <pa...@workscape.com>
>>wrote:
>>
>>>I have found that the environment is not available on Win2K.
>>
>>Java (>= JDK 1.1) doesn't have access to environment variables on any
>>platform I was aware of.
>>
>>>I am wondering if these values are available as properties within
>>>Ant.
>>
>>ANT_HOME will be the property ant.home, if and only if you invoke Ant
>>with the wrapper script that ships with it - JAVA_HOME is vaguely the
>>same as java.home, they are identical for JDK 1.1, but JDK 1.2+ make
>>java.home point to JAVA_HOME/jre.
>>
>>More generally, to access environment variables, take a look at
>><property>'s environment attribute.
>>
>>>The more general question is how can I get a list of the properties
>>>that are available?
>>
>>ant -debug
>>(make sure you capture the stuff somewhere as the output may be
>>overwhelming 8-).
>>
>>Stefan
>
>
>--
>Matt Inger (matt.inger@sedonacorp.com)
>Sedona Corporation
>455 S. Gulph Road, Suite 300
>King of Prussia, PA 19406
>(484) 679-2213
>"Self-respect - the secure feeling that no one,
>as yet, is suspicious." -H.L. Mencken
>
>
>
>_____________________________________________________________________
>This message has been checked for all known viruses by the MessageLabs 
>Virus Scanning Service. For further information visit
>http://www.messagelabs.com/stats.asp


Re: What properties are available

Posted by Matthew Inger <ma...@sedonacorp.com>.
Environment variables are a non standard way of doing things
with java.  The reason they are not readily available is that they
do not exist on all platforms (here is where I cough, and point
fingers at MacOs before version X).

Therefore, they're not available.  the way  you have to make them
available is by passing them on the command line as System properties:

java -Dmy.var=${MY_VAR} test.class



Stefan Bodewig wrote:

>On Thu, 9 Aug 2001, Patrick O'Hara <pa...@workscape.com>
>wrote:
>
>>I have found that the environment is not available on Win2K.
>>
>
>Java (>= JDK 1.1) doesn't have access to environment variables on any
>platform I was aware of.
>
>>I am wondering if these values are available as properties within
>>Ant.
>>
>
>ANT_HOME will be the property ant.home, if and only if you invoke Ant
>with the wrapper script that ships with it - JAVA_HOME is vaguely the
>same as java.home, they are identical for JDK 1.1, but JDK 1.2+ make
>java.home point to JAVA_HOME/jre.
>
>More generally, to access environment variables, take a look at
><property>'s environment attribute.
>
>>The more general question is how can I get a list of the properties
>>that are available?
>>
>
>ant -debug 
>
>(make sure you capture the stuff somewhere as the output may be
>overwhelming 8-).
>
>Stefan
>


-- 
Matt Inger (matt.inger@sedonacorp.com)
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 




Re: What properties are available

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 9 Aug 2001, Patrick O'Hara <pa...@workscape.com>
wrote:

> I have found that the environment is not available on Win2K.

Java (>= JDK 1.1) doesn't have access to environment variables on any
platform I was aware of.

> I am wondering if these values are available as properties within
> Ant.

ANT_HOME will be the property ant.home, if and only if you invoke Ant
with the wrapper script that ships with it - JAVA_HOME is vaguely the
same as java.home, they are identical for JDK 1.1, but JDK 1.2+ make
java.home point to JAVA_HOME/jre.

More generally, to access environment variables, take a look at
<property>'s environment attribute.

> The more general question is how can I get a list of the properties
> that are available?

ant -debug 

(make sure you capture the stuff somewhere as the output may be
overwhelming 8-).

Stefan

Re: What properties are available

Posted by Don Taylor <do...@yahoo.com>.
What do you mean by "I have found that the environment is not available
on Win2K". What exactly does "environment" refer to? What are you
trying to do?

-- Don

--- "O'Hara, Patrick" <pa...@workscape.com> wrote:
> I have a build script that I have been using on Windows NT.  It uses
> the
> environment to get the values of JAVA_HOME and ANT_HOME.  I use these
> values
> to build my class path.  I have found that the environment is not
> available
> on Win2K.  I am wondering if these values are available as properties
> within
> Ant.  It seems to me that Java/Ant must know these values at some
> level.
> The more general question is how can I get a list of the properties
> that are
> available?
> 
> Patrick O'Hara
> Workscape, Inc
> N17 W24222 Riverwood Pl
> Waukesha, WI 53188-1162
> 262-408-3849
> 262-408-3840 Fax
> patrick.ohara@workscape.com
> 
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/