当前位置: 代码迷 >> Eclipse >> Eclipse 中 运用外部jar 来调试java application
  详细解决方案

Eclipse 中 运用外部jar 来调试java application

热度:65   发布时间:2016-04-23 02:21:40.0
Eclipse 中 使用外部jar 来调试java application
1. write a java application

2. export it as jar file, make sure java -jar filename can run without problem

作为调试服务器
1. in the path of jar file, run following comand

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address="8000" -jar Test_fat.jar

2. in eclipse , project, right click debug --> debug configurations

--> remote java application

connection type: sock attach, other item can use default value, at last , click debug

作为调试客户机

1. in eclipse , project, right click debug --> debug configurations

--> remote java application

connection type: sock listen, other item can use default value, at last , click debug

2. 1. in the path of jar file, run following comand

java -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000,suspend=y -jar Test_fat.jar

  相关解决方案