IDEA 远程调试 Remote JVM Debug
IDEA中可以使用 remote jvm debug进行程序的远程调试
1. IDEA配置Remote JVM Debug
在IDEA中可以点击Run/Debug Configurations, 再点击"+"号添加一个Remote JVM Debug,并填写远程服务器的IP地址和端口号
2. 使用参数运行程序
参数
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
启动程序
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar demo-0.0.1-SNAPSHOT.jar
3. 启动IDEA进行debug
使用此方法,可以连接到远程服务器,在本地代码中打上断点,拦截请求至本地,进行debug调试,十分方便!