在Eclipse中一步步调试java程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18977397/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
debug java program step by step in Eclipse
提问by Chriss
I would like to debug the whole flow of a java program line by line and I am using eclipse how can I do that?
我想逐行调试 Java 程序的整个流程,我正在使用 eclipse 我该怎么做?
采纳答案by Juned Ahsan
There are multiple steps required to debug a java program in eclipse such as:
在 Eclipse 中调试 Java 程序需要多个步骤,例如:
- Setting breakpoints
- Starting the debugger
- controlling the program execution. For line by line use F6 and F5 to step into a method
- Evaluating variables etc
- 设置断点
- 启动调试器
- 控制程序的执行。对于逐行使用 F6 和 F5 进入方法
- 评估变量等
Putting everthing here will make the answer too long. I advice you to follow this tutorial :
把一切都放在这里会使答案太长。我建议您按照本教程进行操作:
http://www.vogella.com/articles/EclipseDebugging/article.html
http://www.vogella.com/articles/EclipseDebugging/article.html
回答by Alex Suo
Create a break point in the first line of your main method then using F5 (step into) to walk through it.
在主方法的第一行创建一个断点,然后使用 F5(步入)遍历它。
BTW, such questions are all over the web. To be a good programmer, use google wisely.
顺便说一句,网络上到处都是这样的问题。要成为一名优秀的程序员,请明智地使用 google。
回答by ArockiaRaj
- Set the breakpoints in all the method which you want to debug
- F3 can be used to navigate into the method
- Then start the debugging
- Press F5
- 在所有要调试的方法中设置断点
- F3 可用于导航到该方法
- 然后开始调试
- 按F5