Name

jdb

Synopsis

    jdb [options] [class] [args]

jdb is the Java Debugger. It is a line-oriented debugger, similar to traditional Unix debuggers, providing inspection and debugging of local or remote Java interpreters.

jdb can be used in place of java, in which case the program to be run is already started in the debugger. Or, it may be used to attach to an already running java session. In the latter case, java must have been started with the option -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=PORT. You then attach to the running JVM with jdb -attachPORT, where PORT is the same numeric port number used to run java.

Options

jdb forwards the -v, -D, -classpath, and -X options to the JVM running the program to be debugged. See java.

-attach address

Attach to an already running JVM at port address.

-connectconnector:name=value...

Connect to the JVM using the specified connector.

-J java-option

Pass java-option on to the java program. Useful for changing the execution environment or memory usage. java-option should not contain spaces; use multiple -J options if necessary.

-launch

Start the application immediately, stopping before the initial application class is loaded. This saves having to use the run command from within jdb.

-listconnectors

List the connectors available in this JVM.

-listen address

Wait for a JVM to connect to the debugger at address.

-listenany

Wait for a JVM to connect to the debugger at any address.

-sourcepath path

Use path to search for class and interface ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.