Debugging a visual Java bean or application

If you want to see the Java™ processes and step through the code for your Java visual class while you are running it, you can choose the debug options.

About this task

Like the run commands, the debug commands start a virtual machine and create and use launch configurations. However, by selecting the debug menu options when running, you gain the added benefits of the Debug perspective.

Procedure

  1. Open your visual Java class in the visual editor.
  2. Switch to the Debug perspective by clickingWindow > Open Perspective > Debug from the main menu.
  3. From the main menu, select one of the following commands:
    • Run > Debug As > Java Application if your class has a public static void main(String[]) method.
    • Run > Debug As > Java bean if your class has no main method.
    If you did not switch to the Debug perspective, the launch configuration automatically opens the Debug perspective.

Results

The Debug perspective displays the Java threads and processes that you can work with. You can use the standard Debug perspective options to step through your code using breakpoints.

Feedback