JAVA remote debug

Source: Internet
Author: User

Enable the remote Debug mode of JVM and add the following parameter when starting JVM: // non-blocking mode. After jvm is started, attach to the server at any time-Xdebug-Xnoagent-Xrunjdwp: transport = dt_socket, address = 11312, server = y, suspend = n // block debug. After JVM is started, the JVM will continue to execute this operation only when attach is remotely connected to the corresponding port. -Xdebug-Xnoagent-Xrunjdwp: transport = dt_socket, address = 11312, server = y, suspend = y the second program module is particularly suitable for debugging class initialization. In eclipse, the bug items include Debug Configurations... selected. Select remove java application and create a Project, which is the JAVA source code file Project that you want to remotely debug. HOST is the name or IP address of the server. PORT is the preceding address item 11312. Set the Connection Type to Standard. Click debug. If a connection error occurs after debug. 1. Check whether the server or service has been started. 2. Check whether the configuration is correct. 3. Check whether the port is occupied by other programs. If the above detection is complete, the connection still fails. Restart eclipse or restart server to solve the problem. In addition, the Xnoagent option is generally not required in remote debug. It means <span style = "font-family: Simsun; font-size: 14px;"> Disables VM support for </span> <span style = "font-family: simsun; font-size: 14px; "> oldjdb. Disable the old java debug. </Span> The following describes the various options. From http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/jdb.html-Xdebug Enables debugging support in the VM-Xrunjdwp: transport = dt_shmem, server = y, suspend = n Loads in-process debugging libraries and specifies the kind of connection to be made. -Xnoagent Disables VM support for oldjdb-Djava.compiler = NONE Disables the JIT compiler. this is required for debugging under the classic VM

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.