我正在尝试安装 SOLR 并运行“ant example”构建变得相当远但随后出现错误:
/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/
那也不能解决问题。