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:
- 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.- 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 -helpFor more information about JDB commands:
- Type jdb
- 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.
- 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.- 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:
- http://www.oracle.com/technetwork/java/javase/tech/jpda-141715.html
- http://download.oracle.com/javase/7/docs/technotes/guides/jpda/
- http://download.oracle.com/javase/7/docs/technotes/guides/jpda/jdb.html
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.