Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Eclipse to break on ALL uncaught exceptions?

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?

like image 657
eonil Avatar asked Apr 07 '13 19:04

eonil


People also ask

How do I enable break points in eclipse?

Breakpoints To define a breakpoint in your source code, right-click in the left margin in the Java editor and select Toggle Breakpoint. Alternatively, you can double-click on this position. The Breakpoints view allows you to delete and deactivate Breakpoints and modify their properties.

How do I fix Java exception breakpoint in eclipse?

You can fix this immediately by opening the Markers view and delete the Java Exception Breakpoints. However, to permanently remove this type of breakpoints, you have to go to the Java Debug options and uncheck the "Suspend excecution on uncaught exceptions" option.

What is Java exception breakpoint?

Exception Breakpoint: This type of breakpoint is used to halt execution when a specified exception type is thrown at any time during execution. To set an exception breakpoint in Eclipse, use the "Run -> Add Java Exception Breakpoint..." menu item.


1 Answers

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.

enter image description here

like image 173
eonil Avatar answered Oct 03 '22 17:10

eonil