NonStop Server for Java 7.0 Programmer's Reference

Example 5 When the port number is specified
java -Xdebug -Xnoagent
-agentlib:jdwp=transport=dt_socket,server=y,address=4000,
suspend=y classname arguments
Example 6 When the range of ports are specified and hostname is implicit
java -Xdebug -Xnoagent
-agentlib:jdwp=transport=dt_socket,server=y,address=4000-4050,
suspend=y classname arguments
Example 7 When the machine name and port range are specified
java -Xdebug -Xnoagent
-agentlib:jdwp=transport=dt_socket,server=y,address=someMachine:4000-4050,
suspend=y classname arguments
Starting the Java debugger (JDB) tool
The Java Debugger (JDB) tool can be started so that it communicates with the debuggee by using
the jdb command as described for the following situations:
If you are using JDB on the same NonStop system where the debuggee runs, use the following
command:
jdb -attach portnum
If you are using JDB on a different NonStop system from where the debuggee runs, use the
following command:
jdb -attach host-name:portnum
If you are using JDB from Microsoft Windows or any other platform, use the following
command:
jdb -connect com.sun.jdi.SocketAttach:hostname=hostname,port=portnum
Additional 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 NSJ7 applications are tested with Eclipse 3.7.2 of the Eclipse Project. For
information and software downloads, see http://www.eclipse.org/
For more details on command-line options, see Connection and Invocation Details
Debugging JNI code
Use the inspect debugger tool available on the NonStop system to debug the native code. This
native code is written by application developer, and is used with the Java program. Use Visual
Inspect (the preferred debugger) or Native Inspect to debug the native code. For more information,
see Native Inspect Manual.
You can use the following command to start java in an inspect debugger:
run -debug java java_options
Debugging Java programs 49