
print myObj.myMethod() (if myMethod returns a.print i + j + k (i, j, k are primities and either.Those with method invocations, for example: Print supports many simple Java expressions including Have been compiled with the javac -g option. NOTE: To display local variables, the containing class must See the dumpĬommand below for getting more information about an object. For variables orįields of primitive types, the actual value is printed. print Displays Java objects and primitive values. cont Continues execution of the debugged application after aīreakpoint, exception, or step. Jdb launches the debugged application (as opposed toĪttaching to an existing VM). run After starting jdb, and setting any necessaryīreakpoints, you can use this command to start the execution theĭebugged application. The list of recognized commands with a brief description. Help, or ? The most important jdb command, help displays The Javaĭebugger supports other commands which you can list using The following is a list of the basic jdb commands.

For information on starting a J2SE 1.4.2 or The Java Platform DebuggerĪrchitecture has additional documentation on theseĬonnection options. There are many other ways to connect the debugger to a VM, andĪll of them are supported by jdb. In this case because jdb is connecting to an existing VM Note that "M圜lass" is not specified in the jdb command line You can then attach jdb to the VM with the following agentlib:jdwp=transport=dt_shmem,server=y,suspend=nįor example, the following command will run the M圜lassĪpplication, and allow jdb to connect to it at a laterĬ:\> java -agentlib:jdwp=transport=dt_shmem,address=jdbconn,server=y,suspend=n M圜lass Options load in-process debugging libraries and specify the kind of Jdb must be started with the following options. VM before executing that class's first instruction.Īnother way to use jdb is by attaching it to a Java VM When started this way, jdb invokes a second Java VM withĪny specified parameters, loads the specified class, and stops the M圜lass, you use the following command to debug it under JDB: For example, if your application's main class is This isĭone by substituting the command jdb for java in theĬommand line. (VM) with the main class of the application to be debugged. Used way is to have jdb launch a new Java Virtual Machine There are many ways to start a jdb session. It is a demonstration of the Java Platform DebuggerĪrchitecture that provides inspection and debugging of a local

The Java Debugger, jdb, is a simple command-line debuggerįor Java classes. arguments Arguments passed to the main() method of

class Name of the class to begin debugging. Options Command-line options, as specified below. Jdb - The Java Debugger jdb helps you find and fix bugs in Java language programs.
