build.xml 需要在不同位置的 tools.jar [英] build.xml expects tools.jar at a different location
问题描述
在使用 Ant 构建我的应用程序时,构建成功但一开始它说
While using Ant to build my application, the build is successful but at the beginning it says
无法找到 tools.jar.预计在D:\Java\jre6\lib\tools.jar
Unable to locate tools.jar. Expected to find it in D:\Java\jre6\lib\tools.jar
但是我的 tools.jar 位于 D:\Java\jdk6u30\lib 位置
However my tools.jar is at the location D:\Java\jdk6u30\lib
我知道 tools.jar 包含 jdk 所需的类,并且应该只出现在 jdk lib 中,而不能出现在其他任何地方.我希望我是正确的.我的问题是为什么 build.xml 期望它在不同的位置?我有我的 JAVA_HOME设置为
I understand that tools.jar contains classes needed by jdk and should only be present at jdk lib and nowhere else. I hope I am correct on this. My question is that why does build.xml expects it at a different location? I have my JAVA_HOME set to
D:\Java\jdk6u30
D:\Java\jdk6u30
.
推荐答案
因此,默认情况下,Eclipse 会在您添加服务器时将 jre 视为 已安装的 JRE.将已安装的 JRE 更改为 jdk.
So by default eclipse will take the jre as installed JRE's when you add the server. Change the installed JRE's to jdk.
您可以从 Window->Preferences->Java->installed JRE's
这篇关于build.xml 需要在不同位置的 tools.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!