问题
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.
ExceptionThrowableError
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?
回答1:
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.
回答2:
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.
回答3:
- Window->Show View->Other

- Search for breakpoints which appears Debug->Breakpoints

- Now add Throwable Exception by pressing
J!icon
- Add Exception

来源:https://stackoverflow.com/questions/15866558/how-can-i-make-eclipse-to-break-on-all-uncaught-exceptions



