- First open Eclipse, open the Java source file
- Steps to read
- 2
Double-click on the line number column to the left of the line of code you want to test, create a breakpoint, double-click again to cancel the breakpoint
Steps to read
- 3
Then right-click on Debug As-java application, (note, not select Run as)
Start Debugging Java programs
Steps to read
- 4
There may be a popup box (indicating whether to enter the Debug view) Click OK
The debug view is then performed,
Steps to read
- 5
The upper left is the entire normal thread execution, and the upper right side is a list of line numbers that just set the breakpoint.
There are several buttons on the upper left to note
Steps to read
- 6
These buttons are the control buttons that we debug, respectively:
Step into (shortcut key F5) enters the method of the current line, steps through
Step return (shortcut key F7) Returns the method that was executed in the previous step (relative to F5)
Step Over (shortcut key F6) executes the current line but does not enter execution details
Resume (shortcut key F8) resumes execution, indicating that the code executes and jumps directly to the next breakpoint
Terminate Stop Debugging
Steps to read
- 7
Common debugging methods: Press F8 to jump to the next breakpoint execution if you need to query execution details F5F6F7, etc.
-
- 8
- To cancel a breakpoint: Deselect or delete the current breakpoint in the list of breakpoints in the upper right
How to use the Debug feature of Eclipse (from Baidu Experience)