1: Preparation
In this download package thrown into the war in tomcat, after the start and then you can by ip:port/appname/hello
running visit, we started following it. Download the
source code here .
2: Configure tomcat
Add the following content in catalina.sh
linux/mac
::
export JAVA_OPTS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'
windows
:
set CATALINA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8443
address=
Replace the note with your actual port number.
The screenshot below is what I configured: After the
configuration is complete, throw the war package to tomcat, then start the server, first test that the startup is normal:
3: Configure idea
In Edit Configurations
direct operations according to the screenshot:
Then configure the screenshot described in:
4: Debugging test
Note that the remote tomcat has been started normally before this step, directly debug and start, as shown in the figure below, it is successful:
Then, just like local debugging, break the point, visit, and you can start local debugging, as follows:
5: The way to use the domain name
5.1: Configure hosts
127.0.0.1 www.sublimetext.com
5.2: Modify the idea configuration
As shown in the figure below:
debugging is as follows: