title: Where does Ant set its 'java.home' (and is it wrong) and is it supposed to append '/jre'?
body: <p>Okay, I'm using Ant version 1.7.1 (default install) on CentOS 6.3: </p>
  
  <pre><code>[theuser@dev-ingyhere ~]$ ant -version
  Apache Ant version 1.7.1 compiled on August 24 2010
  [theuser@dev-ingyhere ~]$ cat /etc/*-release
  CentOS release 6.3 (Final)
  </code></pre>
  
  <p>I have <code>JAVA_HOME</code> set and I run <code>ant</code>: </p>
  
  <pre><code>[theuser@dev-ingyhere ~]$ export JAVA_HOME=/usr/java/jdk1.7.0_17 ; echo $JAVA_HOME ;
  /usr/java/jdk1.7.0_17
  [theuser@dev-ingyhere ~]$ ant -diagnostics | grep java\\.home
  java.home : /usr/java/jdk1.7.0_17/jre
  </code></pre>
  
  <p>This is even more fun: </p>
  
  <pre><code>[theuser@dev-ingyhere ~]$ export JAVA_HOME=/a/fools/folly ; echo $JAVA_HOME ; ant -diagnostics | grep java\\.home
  /a/fools/folly
  java.home : /usr/java/jdk1.7.0_17/jre
  [theuser@dev-ingyhere ~]$  env | grep JAVA
  JAVA_HOME=/a/fools/folly 
  </code></pre>
  
  <p>So, I do get one thing -- apparently <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#getProperties()" rel="noreferrer">Oracle's Java 7 Javadoc for Class System</a> is WRONG (aghast!) where it describes the <code>java.home</code> System Property as the "Java installation directory." I know that because the <a href="http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html" rel="noreferrer">Java(TM) Tutorials for System Properties</a> describes the <code>java.home</code> System Property as the "Installation directory for Java Runtime Environment (JRE)." In other words the <code>JAVA_HOME</code> in the environment does not necessarily equal <code>java.home</code> in the JVM System Properties. (What sets that?!) </p>
  
  <p><strong>QUESTION: Where and how does <code>Ant</code> get/set the system property <code>java.home</code>?</strong> </p>