NonStop Server for Java 6.0 Programmer's Reference

Example 1 Example 1:
java -Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,address=4000,
suspend=y classname arguments
The port number is specified in this example.
Example 2 Example 2:
java -Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,address=4000-4050,
suspend=y classname arguments
The range of ports is specified in this example and the hostname is implicit.
Example 3 Example 3:
java -Xdebug -Xnoagent
-Xrunjdwp:transport=dt_socket,server=y,address=someMachine:4000-4050,
suspend=y classname arguments
The machine name and the port range is specified in this example.
Starting the Java Debugger (jdb) Tool
Now, the Java Debugger (jdb) tool can be started to communicate with the debuggee by using
the jdb command as described for various situations.
If you are using JDB on the same NonStop system where the debuggee runs, use
jdb -attach portnum
If you are using JDB on a different NonStop system from where the debuggee runs, use
jdb -attach host-name:portnum
If you are using JDB from Microsoft Windows or any other platform, use
jdb -connect com.sun.jdi.SocketAttach:hostname=hostname,port=portnum
Further Information
If you are using a GUI debugger, refer to the vendors' documentation to configure the debugger
to communicate with the debuggee.
Remote debugging of NonStop Server for Java 6.0 applications has been tested with Eclipse 3.4
of the Eclipse Project. For information and software downloads, see the website at http://
www.eclipse.org/.
For more details on command line options, see Connection and Invocation Details
(http://docs.oracle.com/javase/6/docs/technotes/guides/jpda/conninv.html).
Debugging JNI Code
To debug native code that the application writers wrote and linked with the Java program, use the
inspect debugger tool available on the NonStop system. Use Visual Inspect (the preferred debugger)
or Native Inspect; for further information, see the Native Inspect Manual.
You can use the following command to start java under an inspect debugger:
Debugging Java Programs 57