如何导入和使用com.sun.jdi.VirtualMachine [英] How to import and use com.sun.jdi.VirtualMachine
问题描述
我在包 com.sun.jdi
中发现了一些用于调试的类,如 VirtualMachine ,但我不能使用它,因为Sun JDK7中似乎不存在包。
I found some classes designed for debugging in package com.sun.jdi
like VirtualMachine, but I can't use this because package seems not exist in Sun JDK7.
如何使用此套餐?
BTW。 lib / sa-jdi.jar
与我想要的不一样
BTW. lib/sa-jdi.jar
isn't the same I want
推荐答案
根据此页, VirtualMachine $ c您链接到的$ c>类是
tools.jar
文件的一部分,该文件仅在JDK(不是JRE)中分发。它说......
According to this page, the VirtualMachine
class that you linked to is part of the tools.jar
file which is only distributed in a JDK (not a JRE). It says ...
更新注释2: Attach API在tools.jar中,所以你将需要在CLASSPATH中添加/lib/tools.jar来编译并运行JDK 6上的示例。
"Update Note 2: The Attach API is in tools.jar, so you will need to add /lib/tools.jar in your CLASSPATH to compile and run the example on JDK 6."
...同样的建议也适用于(至少)JDK 7.
... and the same advice would apply on (at least) JDK 7 as well.
这篇关于如何导入和使用com.sun.jdi.VirtualMachine的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!