ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashant <>
Subject Re: Calling Ant using different JDKs
Date Tue, 14 Nov 2006 04:11:06 GMT wrote:
> Hi everybody,
> 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="..." />).
> 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.

Could't you try something like this :

You could define a macrodef wrapper over javac in a common-build.xml. 
This can be imported by the other build files and they would use the 
macrodef wrapper instead of javac directly.

Since you can control the javac version from the common-build.xml, you 
can pick whatever JAVA_HOME version you want.

> Actually I would use "exec" instead of "ant" but it doesn't get the build
> result. So the builds never fail.
> Any suggestions?
> Regards,
> Christian
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message