1. 在项目当中 jvm启动参数中 加入如下参数
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001
2. 在idea中加入 项目远程配置
添加 Remote
Debugger mode: Attach to remote JVM
Transport: Socket
Host:xxx.xxx.xxx.xxx (应用地址) Port:8001 (监听的端口)
如图