Initial debugging displays for Java programs

As you debug your Java™ programs, follow these example displays for your programs. These displays show an example program, named Hellod.

  • Enter ADDENVVAR ENVVAR(CLASSPATH) VALUE ('/MYDIR').
  • Enter this command: RUNJVA CLASS(HELLOD) OPTION(*DEBUG). Insert the name of your Java program in place of HELLOD.
  • Wait for the Display Module Source display to appear. This is the source for the HELLOD Java program.
    
    +--------------------------------------------------------------------------------+
    |                            Display Module Source                               |
    |                                                                                |
    |  Class file name:   HELLOD                                                     |
    |       1  import java.lang.*;                                                   |
    |       2                                                                        |
    |       3  public class Hellod extends Object                                    |
    |       4  {                                                                     |
    |       5  int k;                                                                |
    |       6  int l;                                                                |
    |       7  int m;                                                                |
    |       8  int n;                                                                |
    |       9  int o;                                                                |
    |      10  int p;                                                                |
    |      11  String myString;                                                      |
    |      12  Hellod myHellod;                                                      |
    |      13  int myArray[];                                                        |
    |      14                                                                        |
    |      15  public Hellod()                                                       |
    |                                                                    More...     |
    |  Debug . . .                                                                   |
    |                                                                                |
    |  F3=End program   F6=Add/Clear breakpoint   F10=Step   F11=Display variable    |
    |  F12=Resume       F17=Watch variable   F18=Work with watch   F24=More keys     |
    |                                                                                |
    +--------------------------------------------------------------------------------+
    
  • Press F14 (Work with Module List).
  • The Work with Module List display is shown. You can add other classes and programs to debug by entering option 1 (Add program). Display their source with option 5 (Display module source).
    
    +--------------------------------------------------------------------------------+
    |                                Work with Module List                           |
    |                                                      System:   AS400           |
    |  Type options, press enter.                                                    |
    |    1=Add program   4=Remove program   5=Display module source                  |
    |    8=Work with module breakpoints                                              |
    |                                                                                |
    |  Opt     Program/module     Library          Type                              |
    |                             *LIBL            *SRVPGM                           |
    |          HELLOD                              *CLASS      Selected              |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    |                                                                                |
    |                                                                    Bottom      |
    |  Command                                                                       |
    |  ===>                                                                          |
    |  F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F12=Cancel                   |
    |  F22=Display class file name                                                   |
    |                                                                                |
    +--------------------------------------------------------------------------------+
    
  • When adding a class to debug, you may need to enter a package-qualified class name that is longer than the Program/module input field. To enter a longer name, follow these steps:
    1. Enter Option 1 (Add program).
    2. Leave the Program/module field blank.
    3. Leave the library field as *LIBL.
    4. Enter *CLASS for Type.
    5. Press Enter.
    6. A pop up window is displayed where you have more room to enter the package-qualified class file name. For example: pkgname1.pkgname2.classname