You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by wolverine my <wo...@gmail.com> on 2005/04/26 04:06:21 UTC

How to retrieve Java runtime directory

Hi!

How can we retrieve the directory of the Java runtime which executing
the Ant's build file?

I have two Java versions installed and I would like to print the Java
runtime information when building the programs. Currently, I'm doing
this

  <property environment="env"/>
  <echo message="You are running Java from ${env.JAVA_HOME}"/>

The problem is that the JAVA_HOME is not guarantee to be set correctly.

Is there a better way of doing this?

Appreciate your advice, thank you!

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


Re: How to retrieve Java runtime directory

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
Use just "${java.home}" for JRE path, or "${java.home}/.." usually for JDK.

- Alexey.

wolverine my wrote:

>Hi!
>
>How can we retrieve the directory of the Java runtime which executing
>the Ant's build file?
>
>I have two Java versions installed and I would like to print the Java
>runtime information when building the programs. Currently, I'm doing
>this
>
>  <property environment="env"/>
>  <echo message="You are running Java from ${env.JAVA_HOME}"/>
>
>The problem is that the JAVA_HOME is not guarantee to be set correctly.
>
>Is there a better way of doing this?
>
>Appreciate your advice, thank you!
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>  
>

-- 
------------------------------------------------------------------------
/ Alexey N. Solofnenko
MDL Information Systems, Inc.
work: 510-357-2222x1726
home: http://trelony.cjb.net/
/

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