Current location - Quotes Website - Signature design - How to use debug to debug eclipse programs
How to use debug to debug eclipse programs

Tools/raw materials

eclipse

Method/steps

1. Open the java code file to be debugged and double-click the mouse on the left Set breakpoints (the program will pause when executing here and enter debugging mode). Multiple breakpoints can be set.

2. In the code editing area, right-click the mouse, select Debug As, and then select 1 Java Application

3. A prompt pops up, you need to switch to the debug (Debug) workspace, check Select "Remember my decision" to remember your choice so you won't be prompted again next time, then click Yes.

4. The Debug mode interface is divided into 5 areas

(1) Debug area, which shows what code is currently being debugged and at what line it is

(2) Variables area, displays the value of the variable.

(3) Code editing area

(4) Code structure area, showing each method in the code.

(5) Console area.

5. Click the yellow arrow button in the debugging area to execute the code sentence by sentence, and at the same time, you can see the value changes of the variables in the variable area in real time.

6. Click the green button in the debugging area to directly execute the program and skip all breakpoint debugging.