ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Fuller <jim.ful...@ruminate.co.uk>
Subject Re: how can we find which jre home is in use by ant script?
Date Mon, 14 Mar 2005 12:31:20 GMT
IndianAtTech wrote:

>Hi All,
>
>how can we find which jre home is in use by ant script?
>
>Thanks
>Sudhakar
>  
>

you could print out the following java property to detect JVM in current usage as well

ant.java.version    the JVM version Ant detected; currently it can hold
                    the values "1.1", "1.2", "1.3" and "1.4".
or

java.home

put <echo message="java home=${java.home}"/> in a test target and run it...see what
it prints!

remember you can always access all env variables by using property to 
load up env vars

  <property environment="env"/>

will mean that you can refer to all env vars ala ${env.PATH} will give 
you system PATH and so on....

normally if you are not fiddling with Ant's own run script then  JAVACMD 
- full path of the Java executable, is used. Redefine this if you want 
to invoke a different JVM than JAVA_HOME/bin/java(.exe). You will find 
it in Ant's own run wrapper.

gl, Jim Fuller

note: that if you just have the JRE available many of Ant Tasks wont 
work, they require full JDK.


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


Mime
View raw message