Java eclipse breakpoint debugging

Java eclipse breakpoint debugging

How to debug Java programs?

When you first learn Java, you will feel that ide debugging is good, high-end and wooden. In fact, it is very simple.

Debugging in Eclipse is similar to other IDE debugging steps.

1. Set breakpoints where you think there is something wrong.

In front of the number of lines of code, right-click, and then select toggle breakpoint.

You might ask, how do I know where to place breakpoints?

2. Click debug. If it is a web program, you need to start Tomcat or Apache server in debug mode.

This is very important. The standard start mode cannot enter the preset breakpoint, so it cannot achieve the purpose of debugging.

3. Run the program. When the program runs to the position where the breakpoint was just set, it will stop, and the background color of that line of code will be highlighted.

At this time, you can control the program through screen buttons or keyboard.

The following is the keyboard shortcut for debugging. If it doesn't work, you can check whether there is a keyboard conflict.

For example, the shortcut keys of Youdao dictionary often conflict with resume in debud mode.

Scope function shortcuts

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>