jdb

Name

jdb---The Java Debugger

Availability

JDK 1.0 and later.

Synopsis

jdb [ java options ] class jdb [ -host hostname ] -password password 

Description

jdb is a debugger for Java classes. It is text-based, command-line oriented, and has a command syntax like that of the UNIX dbx or gdb debuggers.

When jdb is invoked with the name of a Java class, it starts another copy of the java interpreter, passing any specified java options to the interpreter. jdb is itself a Java program, running in its own copy of the interpreter. This new interpreter loads the specified class file and stops for debugging before executing the first Java byte-code.

jdb may also be started with the -password and optional -host arguments. Invoked in this way, jdb "attaches itself" to an already running copy of the interpreter. In order for this to work, the Java interpreter running the program to be debugged must have been started with the -debug option. When the interpreter is started with this option, it prints a password that must be used with the jdb -password option.

Once a debugging session is started, you may issue any of the commands described below.

Options

When invoking jdb with a specified class file, any of the java interpreter options may be specified. See the java reference page for an explanation of these options.

When attaching jdb to an already running Java interpreter, the following options are available:

Commands

jdb understands the following debugging commands:

Environment

See Also

java