Catching Java exceptions

It is possible to suspend the execution of thread when an exception is thrown by specifying an exception. Execution can be suspended at locations where the exception is uncaught, caught, or both.

  1. In the Breakpoints view, click the Add Java Exception Breakpoint button or use the equivalent menu item in the context or Run menu. The Add Java Exception Breakpoint page opens.

  2. Either type the name of the exception you want to catch or select it from the list.

  3. At the bottom of the page, use the check boxes to specify how you want execution to suspend at locations where the exception is thrown.

Note: Exception breakpoints can be enabled and disabled and have hit counts set like a regular breakpoint.

Related concepts

Java development tools (JDT)
Breakpoints

Related tasks

Suspending threads
Adding breakpoints
Removing breakpoints
Enabling and disabling breakpoints
Setting method breakpoints
 

Related reference

Breakpoints view

 
 Copyright IBM Corporation 2000, 2002. All Rights Reserved.