【发布时间】:2011-09-11 05:37:23
【问题描述】:
我正在尝试安装 SOLR 并运行“ant 示例”。构建变得相当远,但随后出现错误:
/root/apache-solr-3.2.0/solr/common-build.xml:250: The following error occurred while executing this line:
/root/apache-solr-3.2.0/lucene/contrib/contrib-build.xml:58: The following error occurred while executing this line:
/root/apache-solr-3.2.0/lucene/common-build.xml:298: The following error occurred while executing this line:
/root/apache-solr-3.2.0/lucene/common-build.xml:733: 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-1.6.0-openjdk-1.6.0.0.x86_64/jre"
我已经明确设置了 JAVA_HOME(见下文)
# echo $JAVA_HOME
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/
但是当我运行 ant 时 JAVA_HOME 显示为 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre 而不是 # echo $JAVA_HOME /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/ 。我无法弄清楚这是在哪里设置的。我还设置了 ANT_HOME,正如其他一些帖子中所说的那样,这可能会解决问题。
# echo $ANT_HOME
/usr/share/ant/
这也不能解决问题。
【问题讨论】:
-
如果你运行 java.home 会显示什么:ant -diagnostics | grep java.home
-
您应该在您的问题中添加一个 linux 元标记。
-
我有这个确切的问题。你解决了吗?