Remote debugging Java applications with eclipse

Source: Internet
Author: User
Tags socket java se

Remote debugging is useful for application development. For example, a low-end machine developer that cannot host a development platform, or a debugger on a dedicated machine, such as a WEB server where a service cannot be interrupted. Other scenarios include Java applications that run on devices with low memory or CUP performance, such as mobile devices, or developers who want to separate applications from development environments, and so on.

Prerequisite

Startup configuration Type

Start configuration Save a set of properties for starting a program. The startup configuration type is a unique program that can be started on the Eclipse platform.

If you have not yet installed the program, download Eclipse V3.4 (Ganymede). In Ganymede, the socket listener connector is added to the Remote Java application startup configuration type. Eclipse's latest socket Listening connector allows you to open the Java debugger, which listens for connections on specific sockets. You can open the program being debugged from the command-line option and connect it to the debugger. Before Ganymede is released, there is only one connector connected to the socket, and the machine being debugged must be a debug host connected to the debugger. Because of the limitations of memory and CPU, it is impractical to have a mobile device acting as a host.

For remote debugging, you must use the Java Virtual Machine (JVM) V5.0 or newer versions, such as the Java SE Development Kit (JDK) for ibm®j9 or Sun Microsystem. This article focuses on remote debugging, not the specifics of each Eclipse debugging feature. See Resources for more information on debugging with Eclipse and find the software mentioned above.

JPDA Introduction

Common abbreviations

Jdi-java Debugging interface (Java debug Interface)

Jdt-java Development tools (Java Development tools)

Jdwp-java Debug Network protocol (Java debug Wire Protocol)

Jpda-java Platform Debugger Architecture (Java Platform Debugger architecture)

Jvm-java VM (Java virtual Machine)

JVMDI-JVM Debug Interface (JVM debug Interface)

JVMTI-JVM Tool Interface (JVM Tool Interface)

vm-vm (Virtual Machine)

The Sun microsystem Java Platform Debugger Architecture (JPDA) technology is a multi-tier architecture that allows you to easily debug Java applications in a variety of environments. The JPDA consists of two interfaces (JVM Tool Interface and JDI), a protocol (Java Debug Wire Protocol), and two software components (backend and front-end) for merging them. It is designed to allow debugging staff to debug in any environment. JPDA not only can be used in desktop systems, but also can work well on embedded systems.

JVM Tool Interface (JVMTI) stipulates that a VM must be supplied for debugging (Edit note: Starting from the Java V5, JVMTI will be replaced with V1.4 in the Java jvmdi). The Java debug Wire Protocol (JDWP) describes the format for debugging information, as well as requests that are transmitted between the debugged process and the debugger front-end, and that the debugger front-end implements JDI, such as Eclipse, Borland JBuilder, and so on. According to Sun's JPDA specification, the program being debugged is often called debuggee. JDI is an advanced interface that defines the information and requests for remote debugging. The schema of the debugger is given below.

Listing 1. Java Platform Debugger Architecture

             Components                      Debugger interfaces
                 /    |--------------|
                /     |     VM       |
 Debuggee-----(      |--------------|  <----Jvmti-java VM Tool Interface
                \     |   Back-end   |
                 \    |--------------|
                 /           |
 Comm Channel--(            |  <------------Jdwp-java Debug Wire Protocol
                 \           |
                 /    |--------------|
                /     |  Front-End   |
 Debugger-----(      |--------------|  <----Jdi-java Debug Interface
                \     |      UI      |
                 \    |--------------|

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.