Debugging skill is very important if you want to become a very good programmer.Here I listed some java debugging tools and debugging techniques.Use the following techniques while you troubleshooting java programs.If you involved in very big java project then you might have more chances for debugging.
Types of Java debuggers
There are several types of Java debugging techniques available:
1. IDEs contain their own debuggers (such as IBM VisualAge for Java, Symantec Visual
Cafe, and Borland JBuilder)
2. Stand-alone GUIs (such as Jikes, Java Platform Debugger Architecture javadt, and
3. Text-based and command-line driven (such as Sun JDB)
4. Brute force using an editor (such as Notepad or VI) and eyeballing stack traces
The versions of JDK, JSDI, JSP, and HTML you are using all have an impact on your choice.
Common bug types
1. Compilation or syntactical errors are the first that you will encounter and the easiest
to debug. They are usually the result of typing errors.
2. Logic errors are different from run-time errors because there are no exceptions
thrown, but the output still does not appear as it should. These errors can range from
buffer overflows to memory leaks.
3. Run-time errors occur during the execution of the program and typically generate Java
4. Threading errors are the most difficult to replicate and track down.
Check the following
Verify that your CLASSPATH environment variable is set correctly so that the
debugger and the Java application know where to find your class libraries.
2. Use try/catch blocks frequently to catch and report errors and exceptions.
3. Print the variable value or object using System.out.println().
4. If you are using database c
heck connection related Problem and executing the query alone.
5. If you are using eclipse or netbeans debug using debug GUI option.
6.Use JProfiler it helps you find performance bottlenecks, pin down memory leaks and resolve threading issues.