nowucca.com - personal software technology blog

How can you remotely debug a JVM with an initialization erorr in your application?

The normal debug JVM parameters require you to attach really quickly:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -Xmx512m

By making suspend=y,timeout=5000 the JVM waits 5 seconds for an attach.
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5005,suspend=y,timeout=5000 -Xmx512m

This made it easier to get to my IDE to attach the debugger and still have the initialization code breakpoints get triggered.