Java Platform Debugger Architecture

The Java™ Platform Debugger Architecture (JPDA) consists of the JVM Debug Interface/JVM Tool Interface, the Java Debug Wire Protocol, and the Java Debug Interface. All these parts of the JPDA enable any front end of a debugger that uses the JDWP to perform debugging operations. The debugger front end can either run remotely or run as a IBM® i application.

Java Virtual Machine Tool Interface (JVMTI)

JVMTI supercedes Java Virtual Machine Debug Interface (JVMDI) and the Java Virtual Machine Profiler Interface (JVMPI). JVMTI contains all the functionality of both JVMDI and JVMPI, plus new functions. JVMTI was added as part of J2SE 5.0. In JDK 6, the JVMDI and JVMPI interfaces are no longer offered, and JVMTI is the only option available.

For more information about using JVMTI, see the JVMTI Reference pageLink outside Information Center at the Oracle America, Inc. Web site.

Java Debug Wire Protocol

The Java Debug Wire Protocol (JDWP) is a defined communication protocol between a debugger process and the JVMDI/JVMTI. JDWP can be used from either a remote system or over a local socket. It is one layer removed from the JVMDI/JVMTI.

Start JDWP in QShell

To start JDWP and run the Java class SomeClass, enter the following command in QShell:

java -interpret -agentlib:jdwp=transport=dt_socket,
address=8000,server=y,suspend=n SomeClass

In this example, JDWP listens for connections from remote debuggers on TCP/IP port 8000, but you can use any port number you want; dt_socket is the name of the SRVPGM that handles the JDWP transport and does not change.

For additional options that you can use with -agentlib, see Sun VM Invocation OptionsLink outside Information Center by Oracle America, Inc.

Start JDWP from a CL command line

To start JDWP and run the Java class SomeClass, enter the following command:
JAVA CLASS(SomeClass) INTERPRET(*YES) 
     PROP((os400.xrun.option 'jdwp:transport=dt_socket,address=8000,server=y,suspend=n'))

Java Debug Interface

Java Debug Interface (JDI) is a high-level Java language interface provided for tool development. JDI hides the complexity of JVMDI/JVMTI and JDWP behind some Java class definitions. JDI is included in the rt.jar file, so the front end of the debugger exists on any platform that has Java installed.

If you want to write debuggers for Java, you should use JDI because it is the simplest interface and your code is platform-independent.

For more information on JDPA, see Java Platform Debugger ArchitectureLink outside Information Center by Oracle America, Inc.