Re: how to set JAVA_HOME in antscript build.xml

Kenneth Burgener <[email protected]> Tue, 01 Jul 2008 16:06:04 -0600
Newsgroups gmane.comp.java.anthill
Message-ID <[email protected]>
On 7/1/2008 2:25 PM, Naina Dani wrote:
> So I want to set JAVA_HOME in build.xml of the project, so that 
> JAVA_HOME is set depending on the project being built. Can anybody give 
> me an idea how to do this ?


We have an old project that had to be built with the 1.4 compiler.  To 
do this we used the "executable" parameter to the javac task.


<javac srcdir="${project.test}"
   destdir="${build.test}"
   source="1.4"
   target="1.4"
   debug="on"
   deprecation="off"
   optimize="on"
   fork="yes"
   executable="${jdk1.4}/bin/javac">
   <classpath>
      ...
   </classpath>
</javac>


This might work for you.

Kenneth