How to see the execution steps of a java program

后端 未结 2 504
孤独总比滥情好
孤独总比滥情好 2021-01-25 11:12

I know that Eclipse have a function that allow us to see the steps of execution of a program.

Can anyone tell me how can I find it? I really need it to study and underst

相关标签:
2条回答
  • 2021-01-25 11:39

    Executing your java program step by step you need to follow a few steps:

    • Set a breakpoint by double-clicking left of the very first line of your program, which seems to be something like public static void main(String[] args). The breakpoint looks like this -> enter image description here
    • Open your program in the enter image description here view. (in the standard layout this could be found in the top right corner of your eclipse ide)
    • Start running your program in debug mode enter image description here (in the standard layout this could be found in the toolbar at the top of your eclipse ide)
    • Now you can easily navigate through your program by using the F5-F7 buttons or clicking these icons in the top toolbar enter image description here

    For deeper insight look at the tutorial Here

    0 讨论(0)
  • 2021-01-25 11:42

    Look for the little green bug at the top. If you run it by pressing this icon, your application will run in a new perspective and stop at your breakpoints.

    enter image description here

    Enter breakpoints by clicking the area where you see the blue dot in this picture.

    enter image description here

    Navigate inside of the debugger with:

    enter image description here

    Green arrow is for running till next breakpoint. Red square is for terminating the process. The 90degree arrow goes into methods you invoke showing each step IN the method. The last arrow executes them without showing the steps.

    If you're done with debugging you can switch perspective here.(upper right corner) enter image description here

    0 讨论(0)
提交回复
热议问题