1 Open Port
Modify/apache-tomcat-7.0.40/bin/catalina.sh
In the appropriate position (please make your own judgment, as long as the java_opts can be set before and after the setting) Insert the following settings:
ui_debug= "-server-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,server=y,suspend=n, address=8899"
catalina_opts= "$CATALINA _opts $UI _debug"
java_opts= "-server-xms4096m-xmx6144m"
Restart Tomcat when the modifications are complete and use the PS command to check that the ports are open.
[Email protected] bin]# Ps-ef | grep Tomcat
Root 27586 1 0 10:26 pts/1 00:01:33/usr/java/jdk1.7.0_40//bin/java-dnop-djava.util.logging.manager= Org.apache.juli.classloaderlogmanager-server-xms4096m-xmx6144m-server-xdebug-xnoagent-djava.compiler=none- Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8899-djava.endorsed.dirs=/var/myweb/apache-tomcat-7.0.40/endorsed-classpath/var/myweb/apache-tomcat-7.0.40/bin/ bootstrap.jar:/var/myweb/apache-tomcat-7.0.40/bin/tomcat-juli.jar-dcatalina.base=/var/myweb/ apache-tomcat-7.0.40-dcatalina.home=/var/myweb/apache-tomcat-7.0.40-djava.io.tmpdir=/var/myweb/ Apache-tomcat-7.0.40/temp org.apache.catalina.startup.Bootstrap Start
2 Configuring the Eclipse Remote debugging port
3 Click the Debug button, and Eclipse will be able to attach to the remote JVM for remote debugging.
Note: Before debugging, be aware that synchronizing local and remote Java classes files will cause problems where lines of code do not map correctly.
Java remote Debugging is very useful, compared to Java, the Eclipse CDT for C + + Remote Call support is poor, deployment is difficult.
Using Eclipse remote debugging under Linux