如何将NetBeans配置为仅执行我编写的Java代码

我错过了什么吗? 我很高兴所有的代码都显示了generics集合的工作方式等等。但是,当我想简单地遍历我的代码时,我总是发现自己更深入地研究Java自己的库代码而不是我关心的。

是否可以在步进代码时简单地禁用它 – 我想将所有这些东西视为黑盒子,代码步进只是为了我写的东西。

你知道吗,现在我已经掌握了这个function,是否有可能以这种方式包装我自己的代码,以便我可以只选择我最感兴趣的部分?

如果我不能轻易地在netbeans中,是否有可能在日食?

谢谢

实际上,最简单的方法是转到Window – > Debugging – > Sources并检查要调试的文件并进入。 您很可能只需要检查项目中的其他来源。

但这是最简单的方法。

调试器有不同的“步进”指令:

  • 跳过(NetBeans中的F8Shift + F8

    statementA; // step over: to callB callB(); // step over: to statementB: it will treat the call as a // black-box. statementB; 
  • 步入(Netbeans中的F7

     statementA = callA() + 4; // step into: will step into the expression // and start to debug the "callA()" method. callB(); // step into: will step into the "callB()" method. statementB; // some statements don't have anything to step into 
  • 走出去(Netbeans中的Ctrl + F7

     void methodB() { someStatementB; // stepOut will treat the rest of the method as // a black-box, and you will end up at "someStatementC". } someStatementA; methodB(); someStatementC; 

你需要“跳过”你想要作为黑盒子处理的方法和表达。

要自动“跳过”您不想要的类:

http://h.imagehost.org/0115/NetbeansStepFilter.png

工具选项其他Java调试器步骤filter

⊗不要介入

然后按添加 ,添加java.*javax.* ,以及您不想调试的所有其他类。 这是一个“全局”设置,而不是每个项目!

在eclipse中,您可以定义步骤filter(在调试期间您不想介入的包)。

您可以在“Window / Preferences”中找到配置,然后在“Java / Debug / Step Filtering”中找到配置。

NetBeans 6.8也有步骤filter。

使用工具 – >选项(Mac上的NetBeans->首选项)打开“选项”对话框。alt text http://www.freeimagehosting.net/uploads/af3a99acd3.png

您可以在NetBeans 8.0.2中检查“单步执行filter以获取未过滤的代码”

Java选项 -/> Java调试器窗口”> </p>

</div><!-- #comment-## -->

	<div class=