How do I configure NetBeans to only step through Java code that I've written

前端 未结 5 761
梦如初夏
梦如初夏 2021-01-01 12:52

Am I missing something? I\'m delighted that all that code is there showing how the generic collections work etc. However when I want to simply walk my code I\'m forever fin

相关标签:
5条回答
  • 2021-01-01 13:33

    You can check "step through the filters to reach unfiltered code" in NetBeans 8.0.2

    0 讨论(0)
  • 2021-01-01 13:40

    There are different "stepping" instructions for a debugger:

    • Step over (F8 and Shift+F8 in NetBeans)

      statementA; // step over: to callB
      callB();    // step over: to statementB: it will treat the call as a
                  //  black-box.
      statementB;
      
    • Step into (F7 in Netbeans)

      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
      
    • Step out (Ctrl+F7 in Netbeans)

      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;
      

    You'll need to "step over" methods & expressions you want to treat as a black-box.

    To automatically "step over" Classes that you don't want:

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

    ToolsOptionsMiscellaneousJava DebuggerStep Filters

    ⊗ Do not step into

    And press Add, and add java.* and javax.*, and all other classes you don't want to debug. This is a "global" setting, and is not per-project!

    0 讨论(0)
  • 2021-01-01 13:49

    Actually, the easiest way is to go to Window -> Debugging -> Sources and check off the files that you want to debug and step in to. Most likely you just need to UNcheck the other sources in your project.

    But that's the easiest way to do it.

    0 讨论(0)
  • 2021-01-01 13:54

    NetBeans 6.8 has step filters, too.

    Use Tools->Options (NetBeans->Preferences on Mac) to open the Options dialog..

    0 讨论(0)
  • 2021-01-01 13:56

    In eclipse you can define step filters (packages that you don't want to step in during debugging).

    You'll find the configuration at "Window/Preferences" and then "Java/Debug/Step Filtering".

    0 讨论(0)
提交回复
热议问题