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.

About the Author

William G. Wong | Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sponsored Recommendations

Comments

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