java 找不到 Tools.jar

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11265647/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 04:26:54  来源:igfitidea点击:

Cannot find Tools.jar

javaant

提问by Billybonks

I am trying to build a copy of JOGL

我正在尝试构建 JOGL 的副本

but ant keeps giving me the error cannot find tools.jar.

但是蚂蚁一直给我错误找不到tools.jar。

so i searched within my JDK dir and i also cannot find it. can someone help me with locating tools.jar

所以我在我的 JDK 目录中搜索,我也找不到它。有人可以帮我定位 tools.jar

采纳答案by Jon Skeet

Are you sure you're searching your JDKdirectory instead of the JREdirectory? I'd expect it to be in the JDK libdirectory. For example, on my machine I have:

您确定要搜索的是JDK目录而不是JRE目录吗?我希望它在 JDKlib目录中。例如,在我的机器上,我有:

c:\Program Files\Java\jdk1.6.0_26\lib\tools.jar

If Ant can't find it, make sure you're running the version of Java in the JDK directory rather than the one in the JRE directory.

如果 Ant 找不到它,请确保您运行的是 JDK 目录中的 Java 版本,而不是 JRE 目录中的那个版本。

回答by Hari Reddy

I think your JAVA_HOME points to the JRE and not to the JDK.

我认为您的 JAVA_HOME 指向 JRE 而不是 JDK。

tools.jar is present in the lib folder - http://docs.oracle.com/javase/1.5.0/docs/tooldocs/solaris/jdkfiles.html

tools.jar 存在于 lib 文件夹中 - http://docs.oracle.com/javase/1.5.0/docs/tooldocs/solaris/jdkfiles.html

回答by Sushanta Sinha

Please check your Environment variables: JAVA_HOME and CLASSPATH should points to JDK not JRE

请检查您的环境变量:JAVA_HOME 和 CLASSPATH 应该指向 JDK 而不是 JRE

eg.

例如。

JAVA_HOME: C:\Program Files\Java\jdk1.6.0_25;

JAVA_HOME:C:\Program Files\Java\jdk1.6.0_25;

CLASSPATH: C:\Program Files\Java\jdk1.6.0_25\lib;

类路径:C:\Program Files\Java\jdk1.6.0_25\lib;

and path should points to JDK bin

和路径应该指向JDK bin

C:\Program Files\Java\jdk1.6.0_25\bin;

C:\Program Files\Java\jdk1.6.0_25\bin;