问题描述
当我运行ant它说:
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
Buildfile: build.xml does not exist!
Build failed
我可以使用什么软件包下载所需的文件> C:\程序文件\Java\jre6\lib\tools.jar
What package can I use to download the file required > C:\Program Files\Java\jre6\lib\tools.jar
我刚刚下载了这个:
jre-6u19-windows-i586-s.exe
但不幸的是它似乎是不在... ...
but unfortunately it appears that it was not on it...
推荐答案
Java以2个版本发布:JRE& SDK(以前称为JDK)
Java ships in 2 versions: JRE & SDK (used to be called JDK)
JRE除了不包含编译器外,还不包含JDK中可用的所有库(tools.jar是其中之一)
The JRE in addition to not containing the compiler, also doesn't contain all of the libraries available in the JDK (tools.jar is one of them)
当您下载Java时:,请确保选择JDK版本并进行安装。如果您同时拥有JDK& JRE,确保ANT正在使用JDK,您可以检查JAVA_HOME(环境变量),在命令行中,如果您执行javac -version,您应该获得一个版本说明。
When you download Java at: http://java.sun.com/javase/downloads/index.jsp, make sure to select the JDK version and install it. If you have both a JDK & JRE, make sure that ANT is using the JDK, you can check JAVA_HOME (environment variable), and on the commandline if you do "javac -version" you should get a version description.
这篇关于Ant错误时尝试构建文件,找不到tools.jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!