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:[EMAIL PROTECTED]
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]