Debug Java Anywhere

Sept. 1, 2003
Java platform debugger architecture delivers portability.

Write once, debug/test everywhere is a variant on Java's write once, run anywhere claim, and it defines the Java Platform Debugger Architecture (JPDA).

The JPDA is a client/server system built from three application programming interfaces (APIs). The Java Debug Interface (JDI) is the client interface used by a Java debugger to access the debugging facilities. The JDI uses the Java Debug Wire Protocol (JDWP), which differs from the Java interface definitions associated with the other JPDA APIs.

The JDWP only defines the format of the packets passed between the JDI and the Java Virtual Machine Debug Interface (JVMDI), along with the semantics associated with the data. This allows implementations to exploit any kind of transport mechanism from in-memory exchange between a debugger and application running on the same machine to a TCP/IP connection across the Internet. Keeping the JDWP generic makes it relatively easy to build a debugger on any platform, not just Java.

The JVMDI tells a Java virtual machine (JVM) vendor how to implement a debugging interface to a JVM. Hiding the application behind this interface lets the JVM be implemented in many ways, from a Java bytecode interpreter to a just-in-time (JIT) native code compiler.

The JPDA APIs can be implemented in Java, though it's not a requirement. Sun provides the JDPA library with the associated class and interface definitions. It's used with Sun's JVMs or compatible third-party JVMs. Embedded JVMs often implement the JVMDI and JDWP, with the JDWP supported by a transport mechanism such as a TCP/IP stack. In this case, the debugger is on a remote system, which is typical for embedded development environments.

PICK YOUR JAVA DEBUGGER The advantage of the JDPA is its ability to choose a debugger instead of being restricted to one for a particular Java platform. Often the vendor's matching debugger will have access to additional JVM or operating-system functionality. However, almost any Java debugger can handle application development.

A number of Java debuggers suit use with JDPA. Not surprisingly, Sun has some Java-based debuggers. And, most commercial debuggers that provide Java support use JDPA.

There are also a number of open-source Java debuggers, including one for the Eclipse (www.eclipse.org) project. Another is JSwat (www.bluemarsh.com/java/jswat/) from the Blue Marsh Softworks. It's a standalone Java-based debugger that can handle applications on various platforms because it uses the JDPA library.

JDPA sits below the view of most developers, yet it's still a very important component and key to Java's portability. It also gives developers choices that are unavailable through other development environments.

java.sun.com/products/jpda/

See associated figure.

Sponsored Recommendations

The Importance of PCB Design in Consumer Products

April 25, 2024
Explore the importance of PCB design and how Fusion 360 can help your team react to evolving consumer demands.

PCB Design Mastery for Assembly & Fabrication

April 25, 2024
This guide explores PCB circuit board design, focusing on both Design For Assembly (DFA) and Design For Fabrication (DFab) perspectives.

What is Design Rule Checking in PCBs?

April 25, 2024
Explore the importance of Design Rule Checking (DRC) in manufacturing and how Autodesk Fusion 360 enhances the process.

Unlocking the Power of IoT Integration for Elevated PCB Designs

April 25, 2024
What does it take to add IoT into your product? What advantages does IoT have in PCB related projects? Read to find answers to your IoT design questions.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!