Debugging a Java Program
The quickest way to debug a Java program is to using the Package Explorer view. In the Package Explorer view −- Right click on the java class that contains the main method.
- Select Debug As → Java Application.
Either actions mentioned above create a new Debug Configuration and use it to start the Java application.
If a Debug configuration has already been created you can use it to start the Java application by selecting Debug Configurations from the Run menu, clicking on the name of the debug configuration and then clicking on the Debug button.


The java editor allows users to place break points in the java code. To set a break point, in the editor area right click on the marker bar and select Toggle Breakpoint.

When the execution of code reaches a break point the JVM suspends the execution of the program. At this point, you can inspect the memory and execute the program in a controlled manner.
When the execution of a program is paused, the debug view can be used to inspect the call stack.



No comments:
Post a Comment