How to import and use com.sun.jdi.VirtualMachine

拜拜、爱过 提交于 2019-12-05 11:49:47

问题


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.

How to use this package?

BTW. lib/sa-jdi.jar isn't the same I want


回答1:


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 ...

"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."

... and the same advice would apply on (at least) JDK 7 as well.



来源:https://stackoverflow.com/questions/11099352/how-to-import-and-use-com-sun-jdi-virtualmachine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!