Ant + Vista 64 : “无法找到工具.jar” (jre/jdk conflict?)
我试图在vista 64环境中使用ant来构建一些docbook / xml文件。
但是,我无法解决此错误消息。有人有建议吗?
C:\Users\Robert Admin>ant 找不到工具.jar。预计在 C:\Program Files\Java\jre6\li b\tools 中找到它.jar Buildfile: build.xml 不存在!构建失败
谷歌搜索,我看到这个工具.jar消息是蚂蚁无法找到jdk的结果。事实上,C:\Program Files\Java\jre6\li b\tools.jar是一个与另一个程序一起安装的JRE(我猜)。工具.jar位于此处:C:\Program Files\Java\jdk1.6.0_22\lib
我似乎不能告诉蚂蚁看JDK路径,只能看已经存在的JRE路径。(从蚂蚁文档来看,JRE似乎还不够)。
C:\Users\Robert Admin>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_22\bin
C:\Users\Robert Admin>ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
b\tools.jar
Buildfile: build.xml does not exist!
Build failed
C:\Users\Robert Admin>echo %ANT_HOME%
I:\My Documents\1latest\ant
C:\Users\Robert Admin>where java
C:\Windows\System32\java.exe
C:\Program Files (x86)\Java\jre6\bin\java.exe
C:\Program Files\Java\jdk1.6.0_22\bin\java.exe
C:\Users\Robert Admin>java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)
更新#1。我尝试卸载64位jdk并安装32位jdk。结果:
C:\Users\Robert Admin>java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)
C:\Users\Robert Admin>ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
b\tools.jar
Buildfile: build.xml does not exist!
Build failed
C:\Users\Robert Admin>echo %JAVA_HOME%
C:\Program Files (x86)\Java\jdk1.6.0_22\bin