The Java Debugger

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

Note: 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).
The jdb command is not available on the z/TPF system. Therefore, you must debug any Java application that runs on the z/TPF system from a remote workstation that is installed with IBM® SDK, Java Technology Edition, Version 8. You can install this product by using one of the following methods:
  • A stand-alone Java installation
  • An integrated development environment (IDE) that issues JDB commands behind the scenes, such as the IBM TPF Toolkit
For more information about JDB options, on a remote workstation type:
jdb -help
For more information about JDB commands, complete the following steps on a remote workstation:
  1. Type jdb.
  2. At the jdb prompt, type help.
To use JDB to debug Java applications that are running on remote workstations, JPDA uses a TCP/IP socket to connect to the remote JVM.
  1. Start the JVM on the z/TPF system. Add appropriate options based on whether you are using a class or JAR file. For example:
    java -agentlib:jdwp=transport=dt_socket,server=y,address=<port> <class>
    java -agentlib:jdwp=transport=dt_socket,server=y,address=<port> -jar <jar>
    The JVM starts up, but suspends execution before it starts the Java application.
  2. On a remote workstation, attach the debugger to the remote JVM:
    • On Windows systems:
      jdb -connect com.sun.jdi.SocketAttach:hostname=<host>,port=<port>
    • On other systems:
      jdb -attach <host>:<port>
    Alternatively, you can visually debug your Java application by using the IBM TPF Toolkit. For more information, see the Debug Java applications remotely with Eclipse article on IBM developerWorks®.