使用eclipse远程调试Linux下代码的步骤

时间:2024-03-19 14:54:17

1、 将打好的xxx.jar包放在服务器下
2、 执行命令 :
java -agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y -jar xxx.jar
3、 Eclipse中,右击项目名称选择Debug As –>Debug Configurations–>Remote Java Application
配置服务器IP及代码调试端口:
使用eclipse远程调试Linux下代码的步骤
4、 配置好后,访问服务端代码接口,断点会进入本地eclipse中的代码。

注意:本地代码与服务器上的代码要一样。