Set $JAVA_HOME in eclipse but ANT Cannot Find Java Compiler

二次信任 提交于 2019-12-01 17:39:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!