1: Modify the catalina.sh of Tomcat on Linux, the first line adds Declare-x catalina_opts= "-xdebug-xrunjdwp:transport=dt_socket,server=y, suspend=n,address=9528 "
2: In Eclipse, point "Run->debug ...", select "Remote Java Application", follow the prompts to create a new, "Project" to select the project to debug the code, "host" Select the remote Linux host IP address, " Port Select 8000 on the previous line of address configuration, note that this is a separate, unoccupied port that is not the same as the application's port. 3: Run tomcatbincatalina.sh on Linux to start Tomcat with the following command: Enter the current Tomcatbin directory:./catalina.sh run (so you can see the information running information for Tomcat) or. startup.sh if prompt does not have permission, set permissions as root: chmod +x * * Listening for transport dt_socket at address:9528 " This information indicates that the debug port has been monitored 4: In the Eclipse on Windows "Run->debug ..." check the newly created, click "Debug", if everything is correct there is no prompt. The breakpoint you set in the code will then be executed. 5: About modifying the source code, because Java itself JPDA mechanism, the remote code running effect will be updated in time, but can not update the code on the remote server, this should be noted.
Use Eclipse on Windows to remotely debug Tomcat under Linux