Setting a Java Breakpoint
See Also
Except for line breakpoints, all Java breakpoints are defined globally
and therefore affect all IDE projects that include the source on which
a breakpoint is set. For example, if you set a class breakpoint on com.me.MyClass in
one project, the IDE will stop execution every time it encounters that class
during a debugging session for other projects that include the class.
To set a line breakpoint:
- Click the left margin of the line in the Source Editor or press Ctrl-F8.
To set all other types of breakpoints:
- In the Source Editor, select the code element on which you want to set
a breakpoint. For example, if you want to set a class breakpoint on the class
BeanCounter, select the class name in the class declaration.
- Choose Run > New Breakpoint
(Ctrl-Shift-F8).
The New Breakpoint dialog box opens with a suggested breakpoint
type and target filled in.
- If necessary, adjust the suggested breakpoint type in the Breakpoint
Type combo box.
- Enter the package and class name for which you want to set the breakpoint.
- Set any additional options you require in the New Breakpoint dialog and
click OK.
The IDE creates the new breakpoint for the selected source element.
To modify an existing breakpoint:
- Choose Windows > Debugging > Breakpoints (Alt-Shift-5)
to open the Breakpoints window.
- Right-click any breakpoint and choose Customize to open the Customize Breakpoint
dialog box.
- Adjust any settings or actions you require and click OK.
The IDE updates
the breakpoint for the selected source element.
To enable and disable a breakpoint:
- Right-click the breakpoint in the Breakpoints window and choose Enable or Disable
Notes:
- You can modify and enable line breakpoints by right-clicking the breakpoint
icon in the left margin of the Source Editor and choosing from the Breakpoint submenu.
- You cannot set conditional breakpoints on threads and classes.
- When a debugging session is running, you can use code completion in the New Breakpoint dialog box.
- See Also
- Breakpoints in the IDE
- Setting a Conditional Breakpoint
- Organizing Breakpoints Into a Group
- About Debugging Java Applications
Legal Notices