ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
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,
xalan).


Jan

-----Urspr√ľngliche Nachricht-----
Von: Res Pons [mailto:pons32@hotmail.com] 
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.
 
Rez
_________________________________________________________________
Want to do more with Windows Live? Learn "10 hidden secrets" from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

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


Mime
View raw message