问题描述
我正在用 Java 构建一个项目.
I am building a project in Java.
我有这个错误:
Unable to locate tools.jar. Expected to find it in C:Program FilesJavajre6lib ools.jar
我已经安装了 JDK 和文件夹:C:Program FilesJavajre6lib
在我的系统中,但文件 tools.jar
不在那里.
I have installed a JDK and the folder: C:Program FilesJavajre6lib
is in my system but the file tools.jar
is not there.
推荐答案
如果这对任何人来说仍然是一个问题,我对之前的答案有一些澄清.我在使用仅安装了 JDK 的 ant 时遇到了同样的问题.虽然,JDK 安装程序给了我这样的目录结构:
In case this is still an issue for anyone, I have a bit of clarification on the previous answers. I was running into this same issue using ant with only a JDK installed. Although, the JDK installer gave me a directory structure like this:
Directory of C:Program FilesJava
05/08/2012 09:43 AM <DIR> .
05/08/2012 09:43 AM <DIR> ..
05/08/2012 09:46 AM <DIR> jdk1.7.0_04
05/08/2012 09:19 AM <DIR> jre6
05/08/2012 09:44 AM <DIR> jre7
0 File(s) 0 bytes
当我运行 ant 时,它抱怨在 jre7 子目录下找不到 tools.jar.直到我 set "JAVA_HOME=C:Program FilesJavajdk1.7.0_04"
错误才消失.
and when I ran ant, it complained about not finding tools.jar under the jre7 subdirectory. It wasn't until I set "JAVA_HOME=C:Program FilesJavajdk1.7.0_04"
that the error went away.
这篇关于无法找到 tools.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!