Eclipse remote debug Introduction

Source: Internet
Author: User
Tags jboss

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

Bytes -------------------------------------------------------------------------------------------------------------------

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

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

Set CP = D:/work/reversetest/testclass/bin

Java-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 %-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:

Bytes -------------------------------------------------------------------------------------------------------------------

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

2. Click on the project (right mouse), select "Debug as"-> "Debug deployments... ".

 

3. On the "Debug events" 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.