在eclipse中设置$ JAVA_HOME但是ANT找不到Java编译器

时间:2011-03-14 10:05:30

标签: eclipse ant java-home

我将此行添加到/home/{user}/.bashrc文件:

 export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

但是当我想在eclipse中运行一个ant文件时出现了这个错误:

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"

我该怎么办?

由于

1 个答案:

答案 0 :(得分:9)

转到preferences / java / installed jre - >添加一个新的jre并选择jre / jdk的位置