IBM User Guide for Java V7 on Windows > Developing Java applications > Debugging Java applications



Java Debugger (JDB)

The Java™ Debugger (JDB) is included in the SDK. The debugger is started with the jdb command; it attaches to the JVM using JPDA.

To debug a Java application:

  1. Start the JVM with the following options:
    java -agentlib:jdwp=transport=dt_shmem,server=y,address=<port> <class>
    The JVM starts up, but suspends execution before it starts the Java application.
  2. In a separate session, you can attach the debugger to the JVM:
    jdb -attach <port>
    The debugger will attach to the JVM, and you can now issue a range of commands to examine and control the Java application; for example, type run to allow the Java application to start.

For more information about JDB options, type:

jdb -help
For more information about JDB commands:

  1. Type jdb
  2. At the jdb prompt, type help

You can also use JDB to debug Java applications running on remote workstations. JPDA uses a TCP/IP socket to connect to the remote JVM.

  1. Start the JVM with the following options:
    java -agentlib:jdwp=transport=dt_shmem,server=y,address=<port> <class>
    The JVM starts up, but suspends execution before it starts the Java application.
  2. Attach the debugger to the remote JVM:
    jdb -connect com.sun.jdi.SocketAttach:hostname=<host>,port=<port>

The Java Virtual Machine Debugging Interface (JVMDI) is not supported in this release. It has been replaced by the Java Virtual Machine Tool Interface (JVMTI).

For more information about JDB and JPDA and their usage, see these Web sites:


Parent: Debugging Java applications








Error 404 - Not Found

Error 404 - Not Found

The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.