Debugging Java programs

Debugging is the process of locating and fixing errors in your programs. JBuilder's integrated debugger lets you debug applications and applets within the JBuilder environment. JBuilder Professional also supports servlet debugging and JBuilder Enterprise supports JSP debugging. Many debugger features are accessed through the Run menu. Others are available from the Search, View, and Tools menus.

CodeInsight and syntax highlighting make it easier to debug your source code. JBuilder Enterprise edition also provides cross-process debugging and remote debugging.

For more information on debugging, see "Debugging Java programs" in Building Applications with JBuilder or "Debugging distributed applications" in the Distributed Application Developer's Guide. For more information on CodeInsight and syntax highlighting, see "The JBuilder environment" in Building Applications with JBuilder.


Debugging

You may debug a file or a whole project. You may compile before debugging or not.

To choose whether to compile before debugging, choose Project|Project Properties and select the Run tab. Use the Compile Before Debugging check box at the bottom of the dialog. In JBuilder Professional, you can choose whether and how to use Smart Step; in JBuilder Enterprise, you can choose to enable remote debugging and to make appropriate settings. To do either of these, choose Project|Project Properties and select the Debug tab.

To debug a file, right-click on it in the project pane and choose Debug from the context menu. To set a breakpoint in the source code, either choose Run|Add Breakpoint, click in the gray margin to the left of an executable line of code in the source file, or use the keystroke sequence for your chosen editor emulation.

To debug a project, follow these steps:

  1. Open your project.

  2. Select Project|Project Properties. Choose the Run tab and decide whether JBuilder should compile before debugging.

  3. To set a breakpoint in the source code, either choose Run|Add Breakpoint, click in the gray margin to the left of an executable line of code in the source file, or use the keystroke sequence for your chosen editor emulation.

  4. Choose Run|Debug Project or click the Debug icon   in the toolbar.
The compiler and debugger work the same way on both files and projects:

Debugger in the message pane

For more information on the debugger, see "Debugging Java programs in Building Applications with JBuilder.