Debug a java application without starting the JVM with debug arguments Debug a java application without starting the JVM with debug arguments java java

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


VisualVM isn't a debugger, but you can get thread dumps and heap dumps from it that can be useful in diagnosing some problems. The most useful features require JVM 5 or 6.