I’m trying to use the command “ant build”.The message says java home is not defined correctly we cannot execute /usr/bin/java//bin/java <notice the 2 slashes>
If i use the command echo $JAVA_HOME it returns usr/bin/java . What needs changing here?
The
$JAVA_HOMEvariable does not refer to the java executable, but to the parent directory of thebin/javaexecutable itself. This is the reason Ant complains of not being able to execute some cryptic/usr/bin/java//bin/java.For example, in my case (Ubuntu 12.04, OpenJDK) the java home is set to
where obviously there exists a
/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java, of which/usr/bin/javaultimately represents a symbolic link.