Home>Article>Java> How to debug a program in java

How to debug a program in java

王林
王林 Original
2019-11-20 17:15:33 6630browse

How to debug a program in java

1. Set a breakpoint where you think something is wrong.

Right-click before the line of code. Note that it is the right-click, and then select Toggle Breakpoint.

How to debug a program in java

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

This is very important. The standard Start mode cannot enter the preset breakpoint, and the purpose of debugging cannot be achieved.

How to debug a program in java

#3. Run the program. When the program reaches the breakpoint you just set, it will stop, and the background color of that line of code will be highlighted

How to debug a program in java

4. Enter the debugging interface to view the debugging information

How to debug a program in java

5. Finally, you can modify the program based on the debugging information

Debugging completed!

Recommended tutorial:java introductory tutorial

The above is the detailed content of How to debug a program in java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn