When trying to compile a Javadoc taglet, which requires $JAVA_HOME/lib/tools.jar
, I discovered that ant (version 1.8.4) sets java.home
to $JAVA_HOME/jre
rather than just $JAVA_HOME
. I verified this thusly:
<echo>${java.home}</echo>
<echo>${env.JAVA_HOME}</echo>
[echo] /usr/java/jdk1.7.0_21/jre
[echo] /usr/java/jdk1.7.0_21
According to ant -diagnostics
, there isn't any property like a jdk.home
. Thus, to use tools.jar
I have to do:
<classpath location="${java.home}/../lib/tools.jar"/>
So, I have two questions:
1) Is there something wrong with my setup of ant that's causing java.home
to point to the JRE instead of the JDK?
2) If this is the way ant is supposed to work, is using the ..
in my classpath the way I'm supposed to do things? Or should I do ${env.JAVA_HOME}/lib/tools.jar
? Or something else entirely?