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

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

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