ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: setting up jdk from within Ant
Date Tue, 16 Sep 2008 05:24:49 GMT
You cant really "set" the environman. On some tasks you can set the executable to use (e.g.
<javac> or <javadoc>).
But I think it would be easier to have a batch file which invokes Ant with the right environment.
	@echo off
	set JAVA_HOME=...
	set ANT_HOME=...
	set PATH=...some...standard...entries...;%JAVA_HOME%\bin;%ANT_HOME%\bin
	set BUILDFILE=mybuild.xml
	set ANTLIBS=-lib pathToFirstAntlib.jar
	set ANTLIBS=%ANTLIBS% -lib pathToSecondAntlib.jar
	call ant %ANTLIBS% -f %BUILDFILE% %*

Setting the paths to Antlibs could be done inside the buildfile with Ivy. But some libraries
must be set before the invocation of Ant (bsf + scripting implementation (js), commons-logging,


-----Urspr√ľngliche Nachricht-----
Von: Res Pons [] 
Gesendet: Dienstag, 16. September 2008 00:56
An: Ant Users List
Betreff: setting up jdk from within Ant

Is there any way to set up my jdk environment from within the Ant file?  I'm on Windows Vista
and build different products with different JDK versions from within a DOS window and would
like the build.xml to load the respective jdk.  But not sure how Ant can overwrite the system
environment.  Any input? Thanks for your help.
Want to do more with Windows Live? Learn "10 hidden secrets" from Jamie.!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

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

View raw message