68 Java Stand-alone Applications on z/OS Volume II
in our scenario. Rebuild the project. Now the program contains all necessary
information for debugging.
To enable the JVM on the host for debugging, JVM options have to be set. Open
the JCL in the jcl folder and uncomment the debugging line as shown in
Example 4-4 JVM debugging options in the JCL
# Uncomment the following line if you want to debug the application
IJO="$IJO -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000"
-Xdebug and -Xrunjdwp are the JVM options that support remote debugging. The
transport=dt_socket specifies the communication transport mechanism
between the JVM (server) and debugger (client). Don’t forget to set server=y. It is
the option that lets the JVM listen for the debugger on the port specified in the
address option. Otherwise, the JVM tries to connect to a nonexisting server
because the default value of the server option is n. In the above shell script, the
JVM starts as the debugging server that listens on port 8000.
Other options and explanations for -Xrunjdwp can be found in Table 4-1.
Table 4-1 -Xrunjdwp options
Before you can deploy the application for debugging, debug = yes has to be set
in the zos.properties file. This option forces the submit plug-in not to wait for
Option Name and Value Description Default
suspend=y|n Wait on startup? y
transport=<name> Transport spec none
address=<listen/attach Address> transport spec ""
server=y|n Listen for debugger? n
launch=<command line> Run debugger on event none
Debug on throw none
onuncaught=y|n Debug on any uncaught? n
strict=y|n Skip JVMDI bug
stdalloc=y |N Use C Runtime