Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

2.6 Debugging the Product

Inevitably, during the course of producing a product, you’ll need to debug a problem or you’ll simply have to gain a better understanding of the code through a means more enlightening than just reviewing the source code. You can use the Runtime Workbench to determine exactly what happens during product execution so that you can solve problems.

2.6.1 Creating a configuration

The first step in this process is to create a configuration in which the product can be debugged. Start by selecting Debug Configurations... in the Debug toolbar menu (see Figure 2-21).

Figure 2-21

Figure 2-21 Debug menu.

In the dialog that appears (see Figure 2-22), select Eclipse Application and then click the New 95inline01.jpg button. Next, enter “Favorites” as the name of the configuration.

Figure 2-22

Figure 2-22 Defining a new configuration.

2.6.2 Selecting plug-ins and fragments

After the preceding, select the Plug-ins tab and plug-ins selected below only in the Launch with combo box (see Figure 2-23). In the list of plug-ins, make sure that the Favorites plug-in is selected in the Workspace Plug-ins category but not in the External Plug-ins category.

Figure 2-23

Figure 2-23 Selecting plug-ins in the configuration.

2.6.3 Launching the Runtime Workbench

Click the Debug button to launch the Eclipse Application in the Runtime Workbench to debug the product. Now that you’ve defined the configuration and used it once, it appears in the Debug toolbar menu (see Figure 2-21). Selecting it from that menu launches the Runtime Workbench without opening the Configuration wizard.

After clicking the Debug button in the Configuration wizard or selecting Favorites from the Debug toolbar menu, Eclipse opens a second workbench window (the Runtime Workbench, as opposed to the Development Workbench). This Runtime Workbench window executes the code in the projects contained in the Development Workbench. Making changes and setting breakpoints in the Development Workbench affects the execution of the Runtime Workbench (see Section 1.10, Introduction to Debugging, on page 59 for more about this).

  • + Share This
  • 🔖 Save To Your Account