Tomcat
./catalina.sh JPDA Start
This command launches Tomcat, which listens on port 8000 and waits for the debugger to connect.
Default Listener 8000 port, specify listening port by setting environment variable jpda_address
For example, listen on port 8001:
Export jpda_address=8001
catalina.sh JPDA Start
Java
For newer JDK:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006
Address Specifies the listening port
The above command is recommended for JDK 1.5 and above. For 1.3 and 1.4JDK, use the following command:
For JDK 1.3 or earlier:
-xnoagent-djava.compiler=none-xdebug-xrunjdwp:transport=dt_socket,server=y,suspend=n,address=6006
For JDK 1.4
-xdebug-xrunjdwp:transport=dt_socket,server=y,suspend=n,address=6006
Fromjava TechNotes
From 5.0 onwards THE-AGENTLIB:JDWP option was used to load and specify options to the JDWP agent. For releases prior to 5.0, The-xdebug AND-XRUNJDWP options is used (the 5.0 implementation also supports The-xdebug an D-XRUNJDWP Options But the NEWER-AGENTLIB:JDWP option was preferable as the JDWP agent in 5.0 uses the JVM TI interface T o The VM rather than the older Jvmdi interface)
One more thing to note, FROMJVM Tool interface Documentation:
JVM TI is introduced at JDK 5.0. JVM TI replaces the Java Virtual machine Profiler Interface (JVMPI) and the Java Virtual Machine Debug Interface (JVMDI) W Hich, as of JDK 6, is no longer provided.
Weblogic
Export Debugflag=true
Export debug_port=7878
Set | Grep-i Debug
./startweblogic.sh
Debug_port Specifying ports
Glassfish
Asadmin start-domain--debug [Domain-name]
Default Listener Port 9009
enabling debugging
When you enable the debugging, you enable both local and remote debugging. To start the server in debug mode with the----debugoption as follows:
Asadmin start-domain--debug [Domain-name]
You can then attach to the server from the Java Debugger (JDB) at its default Java Platform Debugger Architecture (JPDA) p ORT, which is 9009. For example, for UNIX systems:
Jdb-attach 9009
For Windows:
Jdb-connect com.sun.jdi.socketattach:port=9009
For more information about Thejdbdebugger, see the following links:
Java Platform Debugger architecture-the java debugger:http://java.sun.com/javase/technologies/core/toolsapis/jpda/
Java Platform Debugger architecture-connecting with jdb:http://java.sun.com/javase/technologies/core/toolsapis/jpda/
GlassFish Server Debugging is based on the JPDA. For more information, SEEJPDA Options.
Can attach to the GlassFish Server using any JPDA compliant debugger, including that Ofnetbeans, Java Studio Enterpris E, JBuilder, Eclipse, and so on.
You can enable debugging even if the GlassFish Server is started without the----debugoption. This is useful if you start the GlassFish Server from the Windows start Menu, or if you want to make sure that debugging I s always turned on.
To Set the Server to automatically Start-in Debug Mode
Use the administration Console. Select the JVM Settings component under the relevant configuration.
Check the Debug Enabled box.
To specify a different port (from 9009, the default) to use when attaching the JVM software to a debugger, specifyaddress= Port-numberin the Debug Options field.
To add JPDA options, add any desired JPDA debugging options in Debug options. SEEJPDA Options.
See Also
For details, click the "Help button" in the administration Console from the JVM Settings page.
IDE Settings IntelliJ
IntelliJ using the default remote settings, you only need to change the port number
Java Tomcat Glassfish weblogic Remote debug (remotely debug)