ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: Calling Ant using different JDKs
Date Mon, 13 Nov 2006 16:57:02 GMT
> is there a way to call an Ant Build-File (<ant  antfile="...">) and pass it
> the JAVA_HOME environment variable?
> Exec accepts just that using the nested env-Argument (<env key="JAVA_HOME"
> path="..." />).

No. You can't even fork <ant>, much less change the JAVA_HOME.

> Basically I'm looking for a way to call a Build-File (build.xml) with
> different JDKs. I cannot fix the javac call to use the different JDKs. I
> need to specify it when calling the build-file.
>
> Actually I would use "exec" instead of "ant" but it doesn't get the build
> result. So the builds never fail.

Your only option is to use <java fork="true">, executing the Ant
launcher, or <exec>, but executing Java and not ant.bat/.sh, as
getting a meaningful error code is more problematic.

There are several examples in the archives for sure. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message