Debug a java application without starting the JVM with debug arguments

You may be able to use jsadebugd (JDK) to attach a debug server to the process (available on Windows with the Debugging Tools for Windows). It is marked as experimental, so you may want to try it out on a test machine first.

Usage:

jsadebugd <pid>
jdb -connect sun.jvm.hotspot.jdi.SADebugServerAttachingConnector:debugServerName=localhost

The connector name withe arg can be found using jdb -listconnectors.


Just to clarify it is not possible to use tools like jdb to attach to already running JVMs > > unless they were started in debug mode

in soviet russia source reads you

jdb -connect sun.jvm.hotspot.jdi.SAPIDAttachingConnector:pid=9426