Debug in Eclipse - ClassNotFoundException
Asked Answered
T

5

16

when i debug in Eclipse a simple console application, I get a lot of ClassNotFoundException lines in the debug Window. It is not an error, somewhat lower in another pane I get "Source not found.". I understand that it is because the source code of the required class is not available, buI would like to skip over these lines... I have to press a lot of times the "step over" or "step out" button to get out of these states.

What can I do in order to avoid these useless lines at all?

Thanks

Thorn answered 24/12, 2010 at 9:14 Comment(1)
#12837903 Remove the breakpoint "ClassNotFoundException"Appressed
E
15

I've been having this problem for a few months now. I'd be debugging a java app and every time I'd hit a constructor, eclipse would try to find matching java core library ClassNotFoundException's source code.

I solved this problem by right-clicking in Debug window on the ClassNotFoundException when I hit it, and clicking on Filter Type. I would then right-click in the debug window again and choose Edit Step Filters.... In the Edit Step Filters window I checked everything in the Defined Step Filters section and unchecked everything in the bottom of the window (Filter synthetic methods, Filter static initializers, etc).

Hope this helps others in the future.

Enjoyment answered 17/9, 2012 at 3:6 Comment(0)
T
13

After Launching Debug Mode.

Go to Window → Show View → Break Points. Now you would be able to see Break Point tab in Debugging mode.

Uncheck the option "ClassNotFoundException: caught and uncaught".

Thermistor answered 18/4, 2015 at 7:42 Comment(0)
B
3

While debugging try Step Return (F7 as shortcut) to get one level up at a time and thus out of the libs you don't have the source attached for.

Breechloader answered 24/12, 2010 at 9:36 Comment(0)
F
3

In a normal application your own code (your java files) is mixed together with code of others (class files in libraries, runtime environment, etc.). Each time you step into a class file you will get this "Source not found"-Warning. (as you already mentioned in your question)

At first you could try to get the source codes for the libraries and link them to your libraries (for example in "project setup => Preferences.../Java Build Path/Libraries => unfold a jar-libraries => Source attachment").

If no source code is available you have to use the debugger-comands to avoid jumping into that class files. "Step Out/Return" might help, but the "Debug View" (which can be found in the top left corner in your "Debug Perspective") could be even more helpful.

In the "Debug View" you can see each thread of your application. If you are currently debugging a thread you can there see the current stacktrace. Instead of clicking F6 and F7 all the time you can also navigate by clicking on an stacktrace-item there.

Tipp: I am using - (Rightclick->"run to line") a lot - this is quite helpful to run over loops, etc.

Frisket answered 24/12, 2010 at 10:49 Comment(0)
L
0

An occurence of ClassNotFoundException is most common in debugging in order to avoid these exceptions, In breakpoints window(Windows>Show View>BreakPoints) uncheck the "ClassNotFoundException: caught and uncaught" to continue with the normal debugging.

Ljoka answered 26/4, 2019 at 6:2 Comment(1)
It's the same advice as in this answerSikkim

© 2022 - 2024 — McMap. All rights reserved.