ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Goktepe" <andrewgokt...@gmail.com>
Subject Re: Setting env var using ant
Date Sun, 14 Sep 2008 18:37:40 GMT
Environment variables available to Ant must be set in the caller's
environment *before* launching the Ant Java process.  So the answer is no,
you cannot set an environment variable within an Ant script the way you
might set one in a shell script.  If you are <exec>ing another command you
can set variables with nested <env>s but that is probably not what you are
looking for.  If you need to compile with different JDKs the "executable"
attribute of <javac> allows for use of different JDK paths.  Most other
things would require <exec> to change JAVA_HOME.

See also:
http://www.nabble.com/Setting-environment-variables-td18781763.html
http://www.jguru.com/forums/view.jsp?EID=1154289

-Andrew

On Fri, Sep 12, 2008 at 7:32 AM, jaki <jackie_james@infosys.com> wrote:

>
> Is there any task which allows you to set environment variables like
> JAVA_HOME using ant?
> --
> View this message in context:
> http://www.nabble.com/Setting-env-var-using-ant-tp19457135p19457135.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message