How to Start a Java Server in Blocking Debug Mode and Connect Remotely via IDE
This guide explains how to launch a Java server in blocking debug mode using specific JVM options and then attach a remote debugger from an IDE, illustrated with command examples and screenshots of the connection setup.
To start a Java backend service in blocking debug mode, run the JVM with debugging options that open a JDWP socket and suspend the application until a debugger attaches.
Use the following command (replace xxx-api.jar with your actual JAR file):
java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=y -jar xxx-api.jarAfter the JVM starts and waits, open your IDE (e.g., IntelliJ IDEA) and create a remote debugging configuration that connects to localhost:9999 . The IDE will then attach to the running process.
The article includes screenshots showing the IDE remote connection dialog and the successful attachment.
Cognitive Technology Team
Cognitive Technology Team regularly delivers the latest IT news, original content, programming tutorials and experience sharing, with daily perks awaiting you.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.