Eclipse remote debug introduction

First we need to load/run the application in remote debug mode:

-------------------------------------------------------------------------------------------------------------------

For a normal Java application loading & running(set a command line script for loading):

 ------------------

SET CP=D:/work/ReverseTest/TestClass/bin

java -cp %CP% -agentlib:jdwp=transport=dt_socket,address=localhost:8888,server=y,suspend=y TestClass

 ------------------

Or config like following:

 ------------------

SET CP=D:/work/ReverseTest/TestClass/bin

java -cp %CP% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=localhost:8888 TestClass

 ------------------

 

For a tomcat or Jboss, weblogic server, please set the following options in its loading shell script.

JBOSS:

Change run.bat/run.sh under JBOSS_HOME/bin(add the red line as following):

JBOSS_HOME: /var/jboss4

JAVA: /usr/java/j2sdk1.4.2_06/bin/java

JAVA_OPTS: -server -Xms128m -Xmx128m -Dprogram.name=run.sh

DEBUG_OPTS = -Xdebug -Xrunjdwp:transport= dt_socket,address=localhost:8888,server=y,suspend=n

CLASSPATH: /var/jboss4/bin/run.jar:/usr/java/j2sdk1.4.2_06/lib/tools.jar

 

TOMCAT:

Change catalina.bat/catalina.sh under TOMCAT_HOME/bin.(add the red line as following)

DEBUG_OPTS = -Xdebug -Xrunjdwp:transport= dt_socket,address=localhost:8888,server=y,suspend=n

 

 

Second we need to config our Eclipse tool to do the remote debug operation:

-------------------------------------------------------------------------------------------------------------------

1. Create a project by using the existed source code:

2. Click on the project(right mouse), select "Debug As"->"Debug Configurations…".

 

3. On the "Debug Configurations" page, click right mouse on the "Remote Java Application"->"New".

4. Fill the configuration page like the following, then click "Apply", set "breakpoints" and then start debug process by clicking "Debug".

5. On the running page, you can see the following screen.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值