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.

Cognitive Technology Team
Cognitive Technology Team
Cognitive Technology Team
How to Start a Java Server in Blocking Debug Mode and Connect Remotely via IDE

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.jar

After 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.

Debug mode start
Debug mode start
IDE remote connection
IDE remote connection
Connection successful
Connection successful
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendIDEremote debuggingjdwp
Cognitive Technology Team
Written by

Cognitive Technology Team

Cognitive Technology Team regularly delivers the latest IT news, original content, programming tutorials and experience sharing, with daily perks awaiting you.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.