Eclipse Debug Debug Debug Java Program debugging
We can debug Java programs in the package Explorer view with the following steps:
- Right-click the Java class that contains the main function
- Select Debug as > Java application
The operation can also be done by shortcut keys, which are combined with ALT + Shift + D, J.
The above operation creates a new debug configuration (debug config) and uses that configuration to launch the Java application.
If the debug configuration has been created, you can select the corresponding class and click the Debug button to launch the Java app by selecting Debug Configurations from the Run menu.
The Debug menu item in the Run menu can reload a Java application that used debug mode.
The Java application shortcut key that was used in debug mode before reloading is F11.
When you use debug mode to open a Java program, the user is prompted to switch to the debug perspective. The Debug perspective provides additional views to troubleshoot the application.
The Java Editor can set breakpoints debugging. In the editor, right-click the marker bar and select Toggle Breakpoint to set the breakpoint debugging.
Breakpoints can be seen in the marker bar. You can also see it in the Breakpoints view (breakpoint views).
The JVM suspends the program when the program executes the code marked by the breakpoint, where you can view memory usage and control program execution.
When the program hangs, the debug view can check the call stack.
The variables (variable) View can view the value of a variable.
The Run menu has a resume menu item, a skip (step over) line of code, a function (step into), and so on.
The shortcut keys for Resume, step into, and step over are shown in the slices.
Eclipse Debug Debug