${env.JAVA_HOME} not found - Ant

One Two Three picture One Two Three · Jul 10, 2013 · Viewed 32.2k times · Source

In my build.xml file, I have these lines:

<property environment="env"/>
<echo message="JAVA_HOME is set to = ${env.JAVA_HOME}" />

On some machine, this would print

"JAVA_HOME is set to = /usr/jdk1.6"

But on some others, it would print this

"JAVA_HOME is set to = ${env.JAVA_HOME}"

Does anyone know what might cause this?

Thanks

Answer

smooth reggae picture smooth reggae · Jul 10, 2013

The message tells you that Ant was not able to resolve the property env.JAVA_HOME; this means that the environment variable JAVA_HOME was not set in that machine.