Debug Java and native method programs

You can debug Java™ programs and native method programs at the same time. While you are debugging your source on the interactive display, you can debug a native method that is programmed in C, which is within a service program (*SRVPGM). The *SRVPGM must be compiled and created with debug data.

The easiest way to debug Java programs and native method programs (or service programs) is to use the IBM® iSeries™ System Debugger. The IBM iSeries System Debugger provides a graphical user debugging environment on your iSeries server. For more information about using the iSeries System Debugger to debug and test programs that run on your iSeries server, see IBM iSeries System Debugger.

To use the interactive display of the server to debug Java programs and native method programs at the same time, complete the following steps:

  1. Press F14 (Work with module list) when your Java program source is displayed to show the Work with Module List (WRKMODLST) display.
  2. Select option 1 (Add program) to add your service program.
  3. Select option 5 (Display module source) to display the *MODULE that you want to debug and the source.
  4. Press F6 (Add/Clear breakpoint) to set breakpoints in the service program. For more information about setting breakpoints, see Set breakpoints.
  5. Press F12 (Resume) to run the program.
Note: When the breakpoint is hit in your service program, the program stops running, and the source for the service program displays.