17

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

kbec
  • 3,415
  • 3
  • 27
  • 42
  • according to [his link](http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/00cd9dc3c2b5/src/share/classes/com/sun/jdi/), `VirtualMachine` _is_ pat of JDK7 – Attila Jun 19 '12 at 10:50

1 Answers1

18

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.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216