This is a shorthand command that is replaced with the text
of the last command entered. It may be followed with
additional text that is appended to that previous command.
- catch [ exception class ]
Cause a breakpoint whenever the specified exception is
thrown. If no exception is specified, the command lists the exceptions
currently being caught. Use ignore to stop these
breakpoints from occurring.
List all classes that have been loaded.
- clear [ class:line ]
Remove the breakpoint set at the specified line of the
specified class. Typing clear or stop with
no arguments displays a list of current breakpoints and the
line numbers that they are set at.
Resume execution. This command should be used when the current
thread is stopped at a breakpoint.
- down [ n ]
Move down n frames in the call stack of the current
thread. If n is not specified, move down one frame.
- dump id(s)
Print the value of all fields of the specified object or
objects. If you specify the name of a class, dump
displays all class (static) methods and variables of the
class, and also displays the superclass and list of
implemented interfaces. Objects and classes may be
specified by name or by their eight-digit hexadecimal ID
number. Threads may also be specified with the shorthand
- exit (or quit)
Run the garbage collector to force unused objects to be reclaimed.
- help (or ?)
Display a list of all jdb commands.
- ignore exception class
Do not treat the specified exception as a breakpoint.
This command turns off a catch command.
- list [ line number ]
List the specified line of source code as well as several
lines that appear before and after it. If no line number is
specified, use the line number of the current stack frame of
the current thread. The lines listed are from the source
file of the current stack frame of the current thread. Use
the use command to tell jdb where to find
- load classname
Load the specified class into jdb.
Display a list of local variables for the current stack
frame. Java code must be compiled with the -g
option in order to contain local variable information.
Display a summary of memory usage for the Java program being
- methods class
List all methods of the specified class. Use dump
to list the instance variables or an object or the class
(static) variables of a class.
- print id(s)
Print the value of the specified item or items. Each item
may be a class, object, field, or local variable, and may be
specified by name or by eight-digit hexadecimal ID number.
You may also refer to threads with the special syntax
t@thread-number. The print command displays an object's value by invoking its
- resume [ thread(s) ]
Resume execution of the specified thread or threads. If no
threads are specified, all suspended threads are resumed.
See also suspend.
- run [ class ] [ args ]
Run the main() method of the specified class,
passing the specified arguments to it. If no class or
arguments are specified, use the class and arguments
specified on the jdb command line.
Run the current line of the current thread and stop again.
- stop [ at class:line ]
stop [ in class.method ]
Set a breakpoint at the specified line of the specified
class or at the beginning of the specified method of the
specified class. Program execution stops when it
reaches this line or enters the method. If stop is
executed with no arguments, then it lists the current
- suspend [ thread(s) ]
Suspend the specified thread or threads. If no threads are
specified, suspend all running threads. Use resume
to restart them.
- thread thread
Set the current thread to the specified thread. This thread
is used implicitly by a number of other jdb
commands. The thread may be specified by name or number.
- threadgroup name
Set the current thread group to the named thread group.
List all thread groups running in the Java interpreter
session being debugged.
- threads [ threadgroups ]
List all threads in the named thread group. If no
thread group is specified, list all threads in the current
thread group (specified by threadgroup).
- up [ n ]
Move up n frames in the call stack of the current
thread. If n is not specified, move up one frame.
- use [ source-file-path ]
Set the path used by jdb to look up source files for
the classes being debugged. If no path is specified,
display the current source path being used.
- where [ thread ] [ all ]
Display a stack trace for the specified thread. If no
thread is specified, display a stack trace for the current
thread. If all is specified, display a stack trace
for all threads.