Debugging in Java

google buzz

Sun provides the Java Platform Debugger Architecture, an API for debugging. The debugger JDB (java debugger) is a simple demonstration of how to use the API. JDB works similarly to GDB. Netbeans and Eclipse offer more comfortable controls. Anyways, in this post I give a short introduction to the JDB command line interface.

Here come the most important commands in JDB:

To run jdb in ubuntu (as stand-alone, or from within an IDE), make sure your hostname corresponds to your current ip address when you are running jdb (edit /etc/hosts, then restart networking). [1]

Launching of application similar to java command

jdb -classpath CP package1.package2.program

As I mentioned, basic commands resemble gdb's. There is run, cont, where (dump trace, similar to gdb's bt), print, next, step.

You set breakpoints with stop. Syntax:

stop in .[(argument_type,...)]
stop at : -- set a breakpoint at a line

As stated before, there are more sophisticated ways to debug java. This video is the first part of an introduction to debugging in java using eclipse. Enjoy!


No Response to "Debugging in Java"

  Subscribe to replies to this post

 
This conversation is missing your voice. Your feedback is appreciated.
Post a Comment


You can use some HTML tags, such as <b>, <i>, <a>

If you see a message that says "your request could not be processed" press preview first and then post.
 
You can follow the discussion of this post by subscribing.


 
You are free to include information from this article on your own site if you provide a backlink. You can use the following markup:
<a href="http://www.myoutsourcedbrain.com/2009/06/debugging-in-java.html">Debugging in Java</a>


 

Most Viewed

Recent Posts

Blog Archive