A launch configuration is a mechanism for defining and saving different
workbench configurations that can be launched separately. You can use launch
configurations for launching debug sessions.
To create a launch configuration for debugging a mixed language
application, complete these steps:
- In a workbench perspective that offers the launch/debug/run action
set (such as the Debug perspective), perform one of the following tasks:
- Select Run > Debug from the workbench menu
bar to open the Debug launch configurations dialog
box.
- Click the down arrow next to the workbench toolbar Debug push
button and choose Debug from the list. This will open
the Debug launch configurations dialog box.
- In the Debug launch configurations dialog
box, perform one of the following tasks:
- Select the Java and Mixed Language Application node
and click New launch configuration.
- Right-click the Java and Mixed Language Application node
and select New from the pop-up menu.
- Double-click the Java and Mixed Language Application node.
- In the Name field, enter a name of your
choice for the configuration that you are creating.
- In the launch configuration, you can use the tabs on the right-hand
side to control specific aspects of the launch:
- The Main tab defines the class to be
launched. Enter the name of the project containing the class to launch in
the project field, and the fully qualified name of the main class in the Main
class field. Check the Stop in main check
box if you want the program to stop in the main method whenever the program
is launched in debug mode.
Note: - You do not have to specify a project, but when you have one you can set
a default class path, source lookup path, and JRE.
- The Stop in main feature is useful if you have
not set any breakpoints in your code.
- The Arguments tab defines the arguments
to be passed to the application and to the virtual machine (if any). You can
also specify the working directory to be used by the launched application.
- The JRE tab defines the JRE used to run
or debug the application. You can select a JRE from the already defined JREs,
or define a new JRE.
Note: If you are debugging other languages
called from Java™, these languages might have specific JRE requirements.
Before choosing a JRE, consult the documentation for the languages that you
want to debug.
- The Classpath tab defines the location
of class files used when running or debugging an application. By default,
the user and bootstrap class locations are derived from the associated project's
build path. You can override these settings here.
- The Source tab defines the location of
source files used to display source when debugging your application. By default,
these settings are derived from the associated project's build path. You can
override these settings here. To change the Source
Lookup Path, perform these tasks:
If you want to search for all instances of the source file name in
the source search path, select the Search for duplicate source
files on the path check box. If you select this check box and
the debugger finds multiple instances of the file name, you will be prompted
by a dialog box to choose the correct source file.
- The Common tab defines general information
about the launch configuration. You can choose to store the launch configuration
in a specific file and specify which perspectives become active when the launch
configuration is launched. You can perform any of these tasks in
the Common page:
- If you want the launch configuration to be stored locally and available
for a single user, ensure that the Local radio button
is selected. If the launch configuration is to be stored as a file in the
workspace and shared in a repository for team use, select the Shared radio
button and enter the project location where you want the launch configuration
to be stored in the Location of shared configuration field.
Alternatively, you can browse for the project.
- If you want the launch configuration to be displayed as a favorite debug
configuration in the Debug push button favorites menu
or the Debug menu Debug History list,
select the Debug check box.
- If all information mandatory to the launch configuration has been
provided, the Debug and Apply push
buttons will be enabled. Clicking Apply will save
the launch configuration, at which point you can choose to close the dialog
box without launching the debug session or you can click Debug to
launch a debug session using the new launch configuration. If you click Debug,
any changes to the launch configuration will be saved and a debug session
will be launched.
After you have saved a debug launch configuration,
you can edit it. For further information about editing debug launch configurations,
see the related task.
Tip: If you have not yet saved launch
configuration settings and if you have made entries in the launch configuration
settings that you want to remove or change, clicking Revert will
remove all changes that you have made.
- If information mandatory to the launch configuration has not been
provided or if there are errors in the information that you have provided,
messages at the top of the dialog box will indicate what is missing.
- When you are finished working in the dialog box, click Close to
exit it.
If you are launching a Web object for debug, once you have launched
a debug session with the debug adapter, you will need to launch the Web object
by entering its URL in a browser.