How to use Intellij Idea's exception breakpoints

It works really well and I don't really know what kind of problems you have with Launcher or ClassLoader. It could be that you have selected to catch Any exceptions and this means that it will catch all kinds of exceptions during the startup and class loading as well. You have to make specific choices about what exceptions to catch, or just go through them all until your exception is caught.

Anyhow I will show you how I set up a very simple case and you'll see that it is working really well.

I have a simple case where a NullPointerException will be thrown.

First you'll have to set up the exception breakpoint.

Enter the View Breakpoints... window by pressing Ctrl+Shift+F8. Then press the little + sign in the upper left corner.

enter image description here

Enter NullPointerException and press the OK button.

enter image description here

Make sure that the Any exception is not checked.

Now run the program by right-clicking inside the main method and select Debug 'SomeClass.main()'

enter image description here

And finally watch when the exception is caught and you will have all the things you expected like call stack and watch window.

enter image description here


I finally figured out by myself. In the View Breakpoints windows, check Any Exception but uncheck the mark for Caught exception. The launcher and class loader exceptions are caught and handled internally by the JVM. This way any user exceptions will be caught without manually specifying the type of exception.