I have a Java project which I am debugging in NetBeans (versions 6.8 and 6.9) and I am unable to step into or step over the code. I can only set breakpoints and then continue to the breakpoints. This is not very convenient. I'd like to be able to step through the code without setting breakpoints everywhere and running to them. I am attaching to the JVM because it cannot be started in NetBeans (it is started by a C program via JNI). Is there an issue related to attaching to a JVM?
If I do happen to try and step into/over a line of code, the debugger hangs (pause button is disabled) and the only option is to detach/end the debug session.
According to NetBeans 6 in Simple Steps (p. 193), Step Over (F8): Executes the current line then moves to the next line. If any line contains call to a method or constructor then executes the entire method or constructor without stepping into them.
Taking a GUI Snapshot or, click the Debug button in the toolbar to start the debugging session. Alternatively, right-click the project node in the Projects window and choose Debug.
A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead. Either actions mentioned above creates a new Debug Launch Configuration and uses it to start the Java application.
When your breakpoint has been hit and you have broken into your java code. Try:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With