I am using the following JVM parameters to start-up a JVM with the hostpot debugger.
-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=0
From within VM:
Properties props = sun.misc.VMSupport.getAgentProperties();
System.out.println(props.getProperty("sun.jdwp.listenerAddress"));
From outside application:
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();
}
Both are not a part of a standard. Applicable only to OpenJDK / Oracle JDK.