Configure Remote Tomcat Debugging in IDEA on CentOS

This guide explains how to configure remote debugging for Tomcat 7 on a CentOS 6.5 server using IntelliJ IDEA, covering the necessary changes to catalina.sh, IDEA remote server settings, connection steps, troubleshooting tips, and verification of a successful debug session.

Java Backend Technology
Java Backend Technology
Java Backend Technology
Configure Remote Tomcat Debugging in IDEA on CentOS

Environment: CentOS 6.5, Tomcat 7.0, IntelliJ IDEA.

Remote Tomcat Settings

1. Add the following line to catalina.sh under CATALINA_OPTS:

CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=60222,suspend=n,server=y"

2. The address=60222 defines the debug port that will be used in IDEA.

IDEA Configuration

1. Add a new Tomcat Server and select Remote .

2. Set the remote Tomcat IP and port (e.g., xxx.xxx.152.67:8080 or a domain) and the debug port 60222. Choose same file system for Remote staging to keep local and remote code synchronized.

3. In Startup/Connection , select Debug , Socket , and set the debug port to 60222.

4. Choose Run and click the debug button (Tomcat must be started first).

5. Verify the connection: the IDE shows a successful connection and Tomcat logs appear.

Troubleshooting

If the port is refused, Tomcat may not be running; restart Tomcat.

If connection fails for other reasons, check the debug port usage on the server. If a process is occupying the port, terminate it (e.g., kill -9 12064) and restart Tomcat, then retry debugging in IDEA.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

IntelliJ IDEAremote debuggingCentOSJava backend
Java Backend Technology
Written by

Java Backend Technology

Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.