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

前端 未结 3 1182
失恋的感觉
失恋的感觉 2021-02-19 00:25

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

相关标签:
3条回答
  • 2021-02-19 00:57

    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.

    enter image description here

    0 讨论(0)
  • 2021-02-19 01:02

    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

    0 讨论(0)
  • 2021-02-19 01:02
    1. Window->Show View->Other
      1
    2. Search for breakpoints which appears Debug->Breakpoints
      2
    3. Now add Throwable Exception by pressing J! icon
      3
    4. Add Exception
      4
    0 讨论(0)
提交回复
热议问题