Today, my colleague told me how to remotely debug a Web application deployed in Tomcat using Eclipse:
- Install the decompressed version of Tomcat, because it seems that there is no catalina. sh (. bat) file in the Tomcat Windows installation directory;
- Modify the JPDA_ADDRESS port in catalina. sh (. bat). For example, by default, this configuration isJPDA_ADDRESS = "8000"Now, change it to the port we want to use. Here we will use 8000 by default;
- Start Tomcat, enter the $ {CATALINA_HOME}/bin directory in command line mode, and enterCatalina. sh (bat) jpda start
- Start Eclipse, select the class you want to Debug and set the breakpoint, and then select the Debug sub-menu in the Debug toolbar. In the pop-up Debug selection window, select remote debugging in the menu on the left, enter the machine name and port, such as localhost and 8000, and then Apply and start Debug;
- Open the browser and enter the page for debugging. The Debug window of Eclipse is activated, and Debug is now available.