ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "PREMKUMAR, N [AG/8042]" <n.premku...@monsanto.com>
Subject RE: changing JAVA_HOME dynamically
Date Sat, 30 Nov 2002 10:05:59 GMT

Option1 :
You may want to try resetting JAVA_HOME to appropriate path (1.4 or 1.3)
just before  starting the task.. 

Option2 : (prefered)

or to be more spefic..you can specify the full path say
C:\myjdk1.4\bin\javac.exe .. the same way one would use
C:\VisualCafe\Bin\sj.exe .. I use symantc compilers from other IDEs this
way..] . The appropriate versions of javac.exe would *include* corresponding
versions of jdk (rt.jar and the stuff..)
- this method would not affect other processes running in the system that
may be dependent on JAVA_HOME .


Thx
Prem



-----Original Message-----
From: Elankath, Tarun (Cognizant) [mailto:ETarun@blr.cognizant.com]
Sent: Saturday, 30 November 2002 1:07 PM
To: Ant Users List
Subject: RE: changing JAVA_HOME dynamically


Count me in.. even I am facing the problem of requiring multiple JDK's for
compilation.

I haven't tried it as yet, but I am going to use the executable attribute of
the javac task and see if things work ok. Will let you know if stuff works
fine.




-----Original Message-----
From: John Lindwall [mailto:JLindwall@Xifin.com]
Sent: Saturday, November 30, 2002 7:01 AM
To: 'Ant Users List'
Subject: RE: changing JAVA_HOME dynamically


I've got the same issue!

I've got a top-level build.xml that builds a project that requires jdk 1.3
for compiling.  This works fine.  I'd like this top-level build.xml to
invoke a child build.xml that builds a project that requires jdk 1.4.1 for
compiling.
 
JAVA_HOME for the build environment is set to the 1.3 JDK so the top-level
build uses 1.3 as expected.  The child build fails since it uses JDK 1.4
features and ant is using JDK 1.3 for the compiles.
 
How can I force the child build to use JDK 1.4?
 
Here's the target in the parent build.xml that invokes the child build.xml.
 
  <target name="build-oe" depends="init" description="Executes the build for
OE" >
    <ant dir="oe" antfile="build.xml" target="build" inheritall="false"  />
  </target>
 
 

-----Original Message-----
From: Euan Guttridge [mailto:EGuttridge@buildonline.com]
Sent: Thursday, November 28, 2002 5:05 AM
To: 'ant-user@jakarta.apache.org'
Subject: changing JAVA_HOME dynamically


I have two Ant builds. One requires JDK1.3.1 and the other JDK1.2.1. Is
there a way to change the JAVA_HOME from within the Ant scripts? I'd like
avoid writing a shell script just to do this..
 
Thanks,
Euan

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


Mime
View raw message