You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Alexandre�POLOZOFF � <di...@polozoff.com> on 2000/09/05 18:16:14 UTC

using system environment variable within ANT?

Hello,

Sorry if this has been asked and answered but I'm new to Ant and have not
been able to find the email archives for this list.

I would like to set the build.compiler properties based on what compiler
is installed (ie; use jikes if jikes is installed).

I have a build.cmd file that sets the environment variable ANT_COMPILER to
jikes if the jikes compiler is installed. I set build.compiler to
${ant_compiler} I get an error from ant that it does not know how to use
${ant_compiler} so it is obviously not expanding my tag... how can I get
this to work?

I'm on Windows NT.

Thanks,
-Alex

---
Sent via the OfficeServant.com web-mail server
Come to the free anytime, anywhere web-based office applications server



Re: using system environment variable within ANT?

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "AP" == AlexandrePOLOZOFF  <" <di...@polozoff.com>> writes:

 AP> I have a build.cmd file that sets the environment variable
 AP> ANT_COMPILER to jikes if the jikes compiler is installed. I set
 AP> build.compiler to ${ant_compiler}

You cannot access system environment variables from Java, you need to
"translate" it into a Java property. Invoking Ant with
-Dbuild.compiler=%ANT_COMPILER% should do it (I'm not sure about the
%VARIABLENAME% syntax, I'm more of a Unix guy).

Stefan

Re: using system environment variable within ANT?

Posted by Peter Donald <do...@mad.scientist.com>.
At 11:16  5/9/00 -0500, you wrote:
>Hello,
>
>Sorry if this has been asked and answered but I'm new to Ant and have not
>been able to find the email archives for this list.
>
>I would like to set the build.compiler properties based on what compiler
>is installed (ie; use jikes if jikes is installed).
>
>I have a build.cmd file that sets the environment variable ANT_COMPILER to
>jikes if the jikes compiler is installed. I set build.compiler to
>${ant_compiler} I get an error from ant that it does not know how to use
>${ant_compiler} so it is obviously not expanding my tag... how can I get
>this to work?

It is case sensitive - try ${ANT_COMPILER}

Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*