Setting a Conditional Breakpoint

See Also

You can set conditions on a breakpoint so that execution only breaks if the condition is true. You can set conditions on any breakpoint except thread breakpoints by selecting the Conditions checkbox and entering the condition. For all breakpoints you can specify how often the breakpoint is triggered by selecting the Break When Hit Count checkbox and choosing a criteria from the drop-down list and specifying a numerical value.

Class breakpoints and exception breakpoints allow you to set the following conditions:

To set conditions on a breakpoint:

  1. Create a new breakpoint or open an existing breakpoint's customizer by right-clicking its name in the Breakpoints window and choosing Customize.
  2. Select the Condition checkbox and type the condition in the Condition field. The condition must follow the Java syntax rules. The condition may include anything that can be on the right side of the equal sign (=). The condition may also include variables and methods that are within the current context. The following are exceptions:
  3. (Optional) Select the Break When Hit Count checkbox and choose a criteria from the drop-down list and specify a numerical value.

Conditional line breakpoints have a conditional breakpoint icon icon in the left margin of the Source Editor.

See Also
Breakpoints in the IDE
Setting a Java Breakpoint
Organizing Breakpoints Into a Group
About Debugging Java Applications

Legal Notices