在Tomcat下新建
setenv.sh
文件运行
chmod 755 setenv.sh
将下面的代码添加到
setenv.sh
文件中1
2export CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n"
Intellij Run/Debug Configurations下新建Tomcat Server Remote
在新建的页面先择
Starup/Connection
标签,然后选择Debug选项
将
Port
的值修改为1043
Tomcat启动后,Intellij即可远程Debug