Java Remote Debug Method--taking eclipse as an example __java

Source: Internet
Author: User
Tags wrapper

Java remote Debugging is the principle of two VM communication between the debug protocol, and then to achieve the purpose of remote debugging. You can communicate between the two by using a socket.
First, the virtual machine of the debug program starts debug mode on startup and starts the debug listener. JDWP is the abbreviation for the Java Debug Wire protocol.


When you start a program, the following parameter options are added to the custom command line, and the program starts in a REMOTEDEUBG-supported manner.

Wrapper.java.additional.1=-xdebug
Wrapper.java.additional.2=-xrunjdwp:transport=dt_socket,server=y,address=7899,suspend=n


The debug option parameter means:

-xdebug enable debugging;
-XRUNJDWP loading jdwp JPDA reference execution instance;
Transport is used to communicate between the debugger and the processes used by the VM;
Dt_socket socket transmission;
Whether the server=y/n VM needs to be executed as a debug server;
address=7899 the port number on which the debugging server listens;
suspend=y/n whether to start the VM after the debugging client establishes a connection.


Once the program is ready, configure Eclipse and let it access the remote VM. The process is fairly simple.

First break the breakpoint in the program, and then

Run-->debug configurations...-->remote Java application--> right key new--> fill in host and port (for example, host:10.75.0.103,port:7899)-->debug


Eclipse Debug Shortcut key:

F5 Step Into
F6 Step Over
F7 Step Out
F8 continue to the next breakpoint



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.