I remember one of my tutors in University, running a project in Netbeans step by step, manually going through each step of the run time. Anyone have any idea how to do this? I can't seem to figure it out.
我记得我在大学的一位导师,一步一步地在Netbeans中运行一个项目,手动完成运行时的每一步。任何人都知道如何做到这一点?我似乎无法弄明白。
2 个解决方案
#1
2
First you need to add breakpoints to your code by clicking on the line number like shown on the image below:
首先,您需要通过单击如下图所示的行号为代码添加断点:
Once you do that you can start you application in debug mode. You do this by clicking the debug button. And the your program will stop at specified debug points. Here is the image of the debug button:
完成后,您可以在调试模式下启动应用程序。您可以通过单击调试按钮来执行此操作。并且您的程序将在指定的调试点停止。这是调试按钮的图像:
You can get more information here: https://netbeans.org/features/java/debugger.html
您可以在此处获取更多信息:https://netbeans.org/features/java/debugger.html
#2
1
Once you place a breakpoint you can continue from there either step by step or even using commands to get into a function and move to the code executed by it. You can see a list of your options in the Debug menu:
一旦你设置了一个断点,你可以一步一步地继续,或者甚至使用命令进入一个函数并转移到它执行的代码。您可以在“调试”菜单中看到选项列表:
F8 - Step Over
F8 - 继续前进
F7 - Step Into
F7 - 踏入
Ctrl + F7 - Step out
Ctrl + F7 - 退出
And so forth. This way you can navigate step by step without the need to have a breakpoint at each step.
等等。这样,您可以逐步导航,而无需在每个步骤都有断点。
#1
2
First you need to add breakpoints to your code by clicking on the line number like shown on the image below:
首先,您需要通过单击如下图所示的行号为代码添加断点:
Once you do that you can start you application in debug mode. You do this by clicking the debug button. And the your program will stop at specified debug points. Here is the image of the debug button:
完成后,您可以在调试模式下启动应用程序。您可以通过单击调试按钮来执行此操作。并且您的程序将在指定的调试点停止。这是调试按钮的图像:
You can get more information here: https://netbeans.org/features/java/debugger.html
您可以在此处获取更多信息:https://netbeans.org/features/java/debugger.html
#2
1
Once you place a breakpoint you can continue from there either step by step or even using commands to get into a function and move to the code executed by it. You can see a list of your options in the Debug menu:
一旦你设置了一个断点,你可以一步一步地继续,或者甚至使用命令进入一个函数并转移到它执行的代码。您可以在“调试”菜单中看到选项列表:
F8 - Step Over
F8 - 继续前进
F7 - Step Into
F7 - 踏入
Ctrl + F7 - Step out
Ctrl + F7 - 退出
And so forth. This way you can navigate step by step without the need to have a breakpoint at each step.
等等。这样,您可以逐步导航,而无需在每个步骤都有断点。