问题
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
回答1:
go to preferences / java / installed jre's -> add a new jre and select the location of your jre/jdk
来源:https://stackoverflow.com/questions/5297146/set-java-home-in-eclipse-but-ant-cannot-find-java-compiler