Reputation: 85975
I am writing a Java program using Eclipse Juno.
When I run the program, and it meets an exception, program just dies with back trace. I set these exception breakpoint to debug at time for any unexpected exceptions.
Exception
Throwable
Error
but, anyway, still I see some uncaught exceptions just makes program crashes instead of breaks by Eclipse. I want to break for any uncaught exceptions. But I can't find option to choose ALL exceptions. How can I make Eclipse to break on any exceptions?
Upvotes: 19
Views: 8897
Reputation: 2039
J!
iconUpvotes: 6
Reputation: 10613
You need to Go to Breakpoints
view > Add Java Exception Breakpoint
then search for Throwable
it will come up with java.lang.Throwable
. Add java.lang.Throwable
and check Subclasses of this exception
just as @Eonil did.
Upvotes: 7
Reputation: 85975
Finally I found it!
I had to explicitly set subclasses of this exception checkbox for each exception in Breakpoints pane.
Also, I need to set NullPointerException
's caught locations too or even uncaught exceptions won't be caught.
Upvotes: 23