从VM内部:
Properties props = sun.misc.VMSupport.getAgentProperties(); System.out.println(props.getProperty("sun.jdwp.listenerAddress"));从外部应用程序:
VirtualMachine vm = com.sun.tools.attach.VirtualMachine.attach(PID); try { Properties props = vm.getAgentProperties(); System.out.println(props.getProperty("sun.jdwp.listenerAddress")); } finally { vm.detach(); }两者都不是标准的一部分。仅适用于OpenJDK / Oracle JDK。



