Why can't I go in / above Java source code in the NetBeans debugger?

I have a Java project that I am debugging in NetBeans (versions 6.8 and 6.9) and I cannot enter or step over the code. I can set breakpoints and then continue breakpoints. This is not very convenient. I would like to skip the code without setting breakpoints everywhere and working with them. I join the JVM because it cannot be started in NetBeans (it is started by the C program through the JNI). Is there a problem with joining the JVM?

If I try to insert / cross out a line of code, the debugger freezes (the pause button is disabled), and the only option is to disconnect / end the debugging session.

+6
java debugging netbeans
source share
3 answers

When your breakpoint was removed and you hit your Java code. Try:

  • Window β†’ Debugging β†’ Sources
  • Add / Confirm that the root directory of your java sources is set to "Source Root".
+7
source share

Having lost so much time setting breakpoints and starting or using Debug \ Debug Project, I got lucky. From the Debug menu, I just selected Step Into, and the IDE started to run my code one step at a time, highlighting the active line and highlighting when a user response is required. (Using the above suggestion to disable Java src code also helps a lot.)

+1
source share

I saw this behavior in the ONE project that comes with the JSP book. The step worked fine in other projects, but in one specific project that executes "Step over", it just moved to the next breakpoint instead of the next line.

I traced the issue with the differences in the debug.classpath property in the project.properties file.

The bad project had this: debug.classpath = $ {build.classes.dir.real}: $ {javac.classpath}: $ {j2ee.platform.classpath}

Good projects with work steps forced this instead: debug.classpath = $ {javac.classpath}: $ {build.classes.dir}

Changing the debug.classpath problem fixes the problem.

0
source share

All Articles