Java command-line options to run a debuggee
For remote debugging, you need to start the Java application to be debugged (debuggee) as a server using the following command:
java -Xdebug -Xnoagent
-agentlib:jdwp=transport
-XdebugEnables debugging.
-XnoagentDisables the old
Sun.tools.debugagent. This is the default value.-agentlib:jdwp=sub-optionssub-optionsare specified in the following format:name1[=value1],name2=[=value2]...Thesub-optionsare as follows:transportIndicates the name of the transport. The value is
dt_socket, and by default, NSJ 11 usesdt_socket.
server=yymeans listen for a debugger applicationaddress=transport-address-for-this-connectionThe transport address is the port number in which the debuggee is listening for the debugger or a range of port value from which the debuggee selects the first available port to listen for the debugger. The following syntax is used:
address=[<name>:]<port> | <start port>-<end port>where,
<name>is the host name.<port>is the socket port number.<start port>is the starting port number for a range of ports.<end port>is the ending port number for a range of ports.suspend=ysuspends the debuggee just before the main class loads.Optionally, you can specify the
-Xintargument, by using only the interpreter and not the HotSpot compiler.
Specifying a range of port numbers for
address is specific to NonStop.
The subsequent examples show the various ways in which the connection address is specified:
When the port number is specified
java -Xdebug -Xnoagent
-agentlib:jdwp=transport=dt_socket,server=y,address=4000,
suspend=y classname arguments

