Table of Contents

Java - Debugger (jdb) (local|remote)

About

Debugger in Java

When you enable debugging, you enable both local and remote debugging.

The Java Platform Debugger Architecture (JPDA) is the architecture designed for use by debuggers and debugger-like tools. It consists of two programming interfaces and a wire protocol.

Jdb

The jdb utility is included in the JDK release as the example command-line debugger. The jdb command demonstrates the Java Platform Debugger Architecture (JDBA)

Jdb doc

Connect the debugger to a JVM

There is a lot of way to connect the debugger to the JVM.

Java

java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass

where:

Attach

jdb -attach 8000

Client

Intellij

https://www.jetbrains.com/idea/help/run-debug-configuration-remote.html

Intellij Run Debug Remote

Server

Maven

@REM set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000

See Maven: Enable remote debugging command line option

X options are options of the JRockit JVM.

Jdwp

Java Debug Wire Protocol (JDWP) defines the format of information and requests transferred between the debuggee process and the debugger front-end.

Documentation / Reference