一、设置JVM支持远程Debug调式
由于我的应用是springboot, 所以直接使用java -jar的方法将服务启动起来。
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8006 -jar dmeo.jar --spring.profiles.active=product
注意:如果配置成这样下面这样,-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8006 放到demo.jar后面,那么远程Debug调式是不起作用的,必须要放到demo.jar的前面才能起作用。
java -jar dmeo.jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8006 --spring.profiles.active=product
二、IDEA中配置远程调试

本文介绍了如何在IDEA中进行远程Debug调试。首先,讲述了设置JVM以支持远程Debug,强调了对于Springboot应用,需确保-Xdebug和-Xrunjdwp参数置于jar文件前。其次,详细说明了IDEA中配置远程调试的步骤。
1万+

被折叠的 条评论
为什么被折叠?



