tags:

views:

1311

answers:

5

As the title suggests what is a good debugger for Java? I've come from a C/C++/Ada background so I've become very accustomed to gdb :). On the java side I've only used jdb and jswat but I would like to ask what java debugger do you recomend and why.

Some background: I'll be using the debugger to debug a Swing Applications running on ( a variant of redhat) linux. The development will be done on windows or linux boxes running under eclipse 3.0. However, I can't use the debugger in eclipse because the application can't be run on the development machine sadly :(

Update 1 re: using eclipse for remote debugging I am testing the swing application in QA enviroment most of the time. The reason I am relecutant to perform remote debugging is because the network enviroment doesn't allow remote access to the machines I'll be runnning the applications (your probably asking why it's set up like this and how I get my binarries on the machines but that's a different problem ;) )

Update 2 Re: why not install Eclipse on where the application will be run (hence no need for remote debugging). That is a good point and I might consider this option. However I'd prefer if I don't need to install a complete IDE just to debug the application.

Is the Eclipse debugger part of eclipse? Or is it a wrapper around a standalone debugger (like ddd/Xcode are simple GUIs to gdb). if it is just a wrapper around a cli debug tool where can I get it from ? :)

Update 3 I'm going to go with the eclipse option and install a trimmed down version as suggested in the comments. Mainly because I'm already used to eclipse and positive feedback regarding it.

+4  A: 

Every IDE worth its salt comes with a debugger and they are generally pretty good. Personally I prefer Eclipse, which contains a very powerful debugger (especially when used with Java 6).

Most (if not all) Java debuggers also support remote debugging (how to do this in Eclipse). This way you can start your application anywhere using some command line parameters and connect to that machine with a debugger from any other machine that can reach it.

Joachim Sauer
see the description, I'm using Eclipse for development but I can't run eclipse on the same maching I am running my application. So I need a seperate IDE
hhafez
replace "I need a seperate IDE" with "I need a seperate Debugger" :$
hhafez
Eclipse (and most Java debuggers) can do remote debugging perfectly well.
Joachim Sauer
+2  A: 

You say "I can't use the debugger in eclipse because the application can't be run on the development machine" - does that mean you want to be able to debug a production application? Or are we talking more of a QA-type environment?

It is possible to do remote debugging with IDE's such as Eclipse or Idea. However, you need to start your server's JVM with various parameters that tell it to listen on a specific port, such as:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
Marc Novakowski
see my comment regarding remote debugging using IDE :)
hhafez
More information about the restrictions on access to the remote machine would help - are you saying that all you have is terminal access? Could you proxy the remote debug socket through an SSH tunnel? Just trying to get creative here (I don't think there are any command-line Java debuggers)
Marc Novakowski
+1  A: 

YourKit Is an excellent standalone debugger. It works on its own, integrates with all populate IDEs, and is great for remote debugging if in fact you need to debug an application running on another machine as you mention. I use it extensively and have nothing but good things to say (well worth the price)

Pete
+1  A: 

The JSwat standalone debugger - http://code.google.com/p/jswat/

jussij
A: 

Well if you like to use a command line debugger like gdb, the Java JDK comes with an equivalent called jdb.