ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Goktepe" <>
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:


On Fri, Sep 12, 2008 at 7:32 AM, jaki <> wrote:

> Is there any task which allows you to set environment variables like
> JAVA_HOME using ant?
> --
> View this message in context:
> Sent from the Ant - Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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