java 缺少库 com.sun.tools.attach
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11901156/
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
Missing Library com.sun.tools.attach
提问by alicjasalamon
I've tried to follow this tutorial, but I have problem with imports.
我尝试按照本教程进行操作,但在导入时遇到问题。
I got:
我有:
The import com.sun.tools cannot be resolved
in line
排队
import com.sun.tools.attach.VirtualMachine;
I've tried to look for some info on Sun/Oracle website, but I have not found anything helpful.
我试图在 Sun/Oracle 网站上查找一些信息,但没有找到任何有用的信息。
I am developing on JDK 1.6.0_31.
我正在 JDK 1.6.0_31 上开发。
回答by Nathan
tools.jar
needs to be added to the IDE's library path and the program's classpath. The tools.jar
file is found in the JDK's lib
directory.
tools.jar
需要添加到 IDE 的库路径和程序的类路径中。该tools.jar
文件位于 JDK 的lib
目录中。
For example, if the JDK were installed into C:\Program Files\Java\jdk1.7.0_11
then the tools.jar
file will be found at C:\Program Files\Java\jdk1.7.0_11\lib\tools.jar
.
例如,如果安装了 JDK,C:\Program Files\Java\jdk1.7.0_11
那么该tools.jar
文件将位于C:\Program Files\Java\jdk1.7.0_11\lib\tools.jar
.
回答by Roman C
You should add tools.jar
to your classpath
.
您应该添加tools.jar
到您的classpath
.
回答by amicngh
Refer this tutorial to include tools.jar
.
请参阅本教程以包含 tools.jar
.
http://hobione.wordpress.com/2009/03/11/missing-comsuntoolsjar142/
http://hobione.wordpress.com/2009/03/11/missing-comsuntoolsjar142/