I prefer setting breakpoints in the regular Java editor views (from the right-click menu of the left gutter); any debug execution and any remote debugging session will stop where I specify.
In most cases using breakpoints should be more useful and convenient than setting a global option to stop only at the beginning of the main() method as SuperVGA suggests, since you can both stop execution near multiple arbitrary interesting places and allow uninteresting execution paths and other programs to run to completion without annoying pauses.
The Debugger perspective has a nice Breakpoints view that can be used to set breakpoints on thrown and caught exceptions and to review, enable, disable and delete breakpoints without chasing them throughout source files.
I agree, but I only told how to do it as an answer to Tom_Mai's question "...before stopping at the first line of code..."
- There's nothing as infuriating as stepping from main() all the way to the 20000th frame because that's around the point I'm through the menu, my world has loaded, and the buggy AI discovers an ammo crate.
Also, I strongly encourage using breakpoint conditions where possible. In the Borland/Embarcadero IDE, there was/is an option to enable and disable entire breakpoint groups. Powerful stuff. I don't think Netbeans or VS does this....
Edited by SuperVGA, 14 October 2013 - 10:01 AM.