运行springboot项目并开启debug端口
java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 remote-debug-0.0.1-SNAPSHOT.jar
通过-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 在启动时开启debug监听端口,其中address配置监听端口
注意:此时jdk为5-8,如果为其他版本,具体如下所示:
当>=9时:
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
当=4时:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
当<4时:
-Xnoagent -Djava.compiler=NONE -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
启动项目成功
idea 配置远程连接
20190801205348.png 20190801205446.png 20190801205558.png 20190801205628.png插入断点调试代码
网友评论