I add this line to /home/{user}/.bashrc
file:
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk
but when I want to run an ant file in eclipse got this error:
BUILD FAILED
/home/bakish/Work/new/hadoop-0.20.2/build.xml:316: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-openjdk/jre"
what should I do?
Thanks
Start -> Control Panel -> System -> Advanced -> Environment Variables. ... and you need to set JAVA_HOME (which is distinct from the PATH variable you mention) to reference the JDK home directory, not the bin sub-directory; e.g. "C:\program files\java\jdk". Save this answer.
Eclipse has its own Java compiler, which is called [JDT Core][1] (org. eclipse. jdt.
JAVA_HOME is an operating system (OS) environment variable which can optionally be set after either the Java Development Kit (JDK) or the Java Runtime Environment (JRE) is installed. The JAVA_HOME environment variable points to the file system location where the JDK or JRE was installed.
go to preferences / java / installed jre's -> add a new jre and select the location of your jre/jdk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With