Home > coding, intellij, java > Java remote debugging JVM options

Java remote debugging JVM options

Java 5, 6, 7 and newer

The Java™ Platform Debugger Architecture (JPDA) supports certain JVM invocation options.

Usually this boils down to:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=4444

This will cause your JVM process to execute (suspend=n) and listen for a socket connection from a remote debugging client on port 4444.

Java 1.4

If you are for some terrible reason stuck on Java 1.4, then you must use the older approach like this:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4444

Tomcat

To enabled remote debugging for a Apache Tomcat on Windows, create bin\setenv.bat in your Tomcat installation, with this content:
set "CATALINA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=4444"

Intellij configuration

Add a debug configuration via Run menu:

remote-debug-intellij

Advertisements
Categories: coding, intellij, java Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: