Name
jdb — The Java Debugger
Synopsis
jdb [options]class[program options] jdbconnect options
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 used with C and C++ programs.
jdb is written in Java, so it runs within a Java interpreter. When jdb is invoked with the name of a Java class, it starts another copy of the java interpreter, using any interpreter options specified on the command line. The new interpreter is started with special options that enable it to communicate with jdb. The new interpreter loads the specified class file and then stops and waits for debugging commands before executing the first byte code.
jdb can also debug a program that is already
running in another Java interpreter. Doing so requires that special
options be passed to both the java interpreter
and to jdb. See the -attach
option below.
jdb expression syntax
jdb debugging
commands such as print, dump,
and suspend allow you to refer to classes,
objects, methods, fields, and threads in the program being debugged.
You can refer to classes by name, with or without their package
names. You can also refer to static class members by name. You can refer to individual objects by object ID, which is an eight-digit hexadecimal integer. Or, when the classes you are debugging contain local variable information, you can often use local variable names to refer to objects. You can use normal Java syntax ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access