How to debug remote debugging of Java application in production environment __java

Source: Internet
Author: User

Java itself supports debugging and provides a simple debugging tool--jdb, similar to the powerful Gdb,jdb is also a character interface debugging environment, and support the setting of breakpoints, support thread-level debugging.

1. Add to the process startup parameters on the server:

-xdebug-xrunjdwp:transport=dt_socket,address=6666,server=y,suspend=n

Connecting to the debugging services provided by myhost:6666

-xdebug is to notify the JVM to work in debug mode,

-XRUNJDWP is to notify the JVM to use (Java Debug Wire protocol) to run the debugging environment. This parameter also has a series of debugging options:
Transport specifies how debug data is transmitted

Dt_socket refers to the use of socket mode

Whether the server=y/n VM needs to be executed as a debug server.

suspend=y/n whether to start the VM after the debugging client establishes a connection.

Start the service side

2. Debugging clients

Set Debug configurations-->remote Java application


3. Click Debug, the operating effect is as follows, and the local debugging is exactly the same.


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.