JAVA_HOME不指向JDK [英] JAVA_HOME does not point to the JDK
问题描述
我想遵循有关如何使用Ant来构建和运行应用程序的教程。我已经照着所有的步骤和创建的构建文件,但是当我尝试运行蚂蚁它给了我这个错误。
I am trying to follow a tutorial about how to use ant to build and run your application. I've followed all the steps and have created the build file, but when I try to run ant it gives me this error.
构建失败
/home/bilal/tmp/ant/build.xml:19:无法找到javac编译器;
com.sun.tools.javac.Main不在类路径中。
也许JAVA_HOME不指向JDK。
它当前设置为/ usr / lib目录/ JVM / JAVA-6的OpenJDK / JRE
BUILD FAILED /home/bilal/tmp/ant/build.xml:19: 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"
任何想法如何解决这个问题?
Any ideas how to resolve this issue ?
推荐答案
请的 JAVA_HOME 的变量指向一个 JDK 安装,没有的 JRE 。
Make JAVA_HOME variable point to a jdk installation, not jre.
您引用的运行时环境,而不是开发工具包 - 它不能找到编译器,因为它不存在。
You are referencing the runtime environment, not the development kit - it can't find the compiler because its not there.
从您发布的线,其中规定必须公开的JDK你可以删除在年底JRE:
From the line you posted, which states you have open-jdk you can just remove the jre at end:
export JAVA_HOME='/usr/lib/jvm/java-6-openjdk/'
这篇关于JAVA_HOME不指向JDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!