IDEA远程调试服务器代码

先在idea添加一个remote,host填服务器ip,port填监听服务器端口,默认5005


然后在服务器tomcat catalina.sh 添加(红色部分):

JAVA_OPTS="$JAVA_OPTS -Dsuperdiamond.projcode=desktop-web -Dsuperdiamond.host=***.***.***.*** -Dsuperdiamond.port=8283 -Dsuperdiamond.profile=production

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
最后debug启动添加的remote实现远程调试服务器代码了(远程和本地代码要一致)

原文地址:https://www.cnblogs.com/AnonymouL/p/8286795.html