ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <>
Subject Re: FW: Can't find the files
Date Fri, 06 Apr 2001 19:19:02 GMT
----- Original Message -----
From: "Pinar Bicioglu" <>
To: <>
Sent: Friday, April 06, 2001 7:41 PM
Subject: RE: FW: Can't find the files

> Everything is working fine now. But I have a question about setting them
> an enviroment variables. How do we do that ? And can we solve this problem

You can do that in the following way:

1) set the environment variable
C:\> set MY_VAR=Test

2) Tell Ant to read in your environment
Place a line like

<property environment="prefix"/>

in your build.xml in a place which is executed before you use these

3) Use them
If you followed the example you should have a property prefix.MY_VAR which
can be used for example with the echo-task

<echo message="${prefix.MY_VAR}"/>

4) Done.

> without involving user work in it. Do they have to make changes with every
> way ?

Someone must get involved. The only way that would come to my mind would be
a custom task that searches all available drives (on windows) and
directories for a file named for example rt.jar and examines that file to
gues if it *could* be a JDK Vwhatever. If time doesn't matter... Keep in
mind that setting an environment variable or editing a configuration file is
a one time action if it's done in the right place (autoexec.bat, ~/.profile,
~/, %UserProfile%\, ...)


View raw message