无法找到 tools.jar.预计在 C:\Program Files\Java\jre6\li b\tools.jar 中找到它 [英] Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li b\tools.jar
问题描述
当我尝试运行以下命令时出现错误:
When I try to run the following command I get an error:
$ ant -Dsdk.dir=/opt/google/appengine-java-sdk runserver -Dserver.host=192.168.1.10
这里是错误:
无法找到 tools.jar.希望在 C:\Program 中找到它Files\Java\jre6\li b\tools.jar".
"Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li b\tools.jar".
我在 JAVA_HOME
变量中给出了 jdk 路径为 C:\PROGRA~1\Java\jdk1.6.0_25
因为我的 jdk 位置是 C:\Program Files (x86)\Java\jdk1.6.0_25
.
I have given jdk path in JAVA_HOME
variable as C:\PROGRA~1\Java\jdk1.6.0_25
as my jdk location is C:\Program Files (x86)\Java\jdk1.6.0_25
.
这是什么问题?请帮助我.提前致谢.
What is the issue? Please help me.Thanks in advance.
当我尝试运行命令 ant -diagnostics 时,我得到了
When I have tried to run the command ant -diagnostics , I got
java.home : C:\Program Files\Java\jre6
推荐答案
你应该尝试在你的 PATH 环境变量的开头添加 %JAVA_HOME%\bin (给定的语法当然假设 Windows).正如 Peter Knego 评论的那样,tools.jar 存在于 JDK 中,而不是 JRE 中,因此您必须确保 JAVA_HOME 指向您的 JDK 目录.
You should try adding %JAVA_HOME%\bin at the beginning of your PATH environment variable (given syntax assumes Windows of course). As Peter Knego commented, tools.jar exists in the JDK, not the JRE, so you must make sure the JAVA_HOME points to your JDK directory.
这篇关于无法找到 tools.jar.预计在 C:\Program Files\Java\jre6\li b\tools.jar 中找到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!