I recently upgraded to helios and now every time I step into a constructor for a class (e.g. Cat myCat = new Cat();
), eclipse debugger shows the stack as
:
To get to the actual constructor code, I have to step out several times which is annoying. This is happening with every class and despite the stack I never see any error messages in the console. How do I fix this so it directly steps into the constructor for my class?
This only happens the first time the class is used, and even for classes that are in the same src file as the current one.
Goto Windows - > preference -> General -> perspectives -> make default your perspective or press reset to default to forget the previous settings. Save this answer.
Set a breakpoint in your main class by clicking in the left margin of the line where you want to set the breakpoint. The line with the breakpoint is highlighted in pink. Right-click the project's node again and choose Debug Project. The target should run and start execution of the program.
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.
Eclipse has a step filter preference in the Java debugger preferences. Its default preference filters out java.lang.ClassLoader
, however this wasn't working. This might have something to do with recently having installed and switched to using jre7. To solve my problem I added a filter to step through any code in the java.lang
package.
I think the ClassNotFoundException is just happening as a part of class loading -- the problem is that you have a breakpoint set to trigger when those exceptions are thrown. My guess is that your version of Eclipse has this breakpoint on by default, whereas the old one didn't.
Check out this link, which reports a similar problem and provides the solution, which is just to disable that breakpoint.
(In the interest of teaching to fish and all that, the google search term was "eclipse debugger launcher$appclassloader".)
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