Creating a local Java application launch configuration

You can use launch configurations to control various aspects of launching a Java application. The Java Application launch configuration type is used to launch local Java applications. Java application launch configurations can be launched in run or debug mode.

  1. From the Run menu, or the Debug drop down menu, select Debug.... This opens the launch configuration dialog, where launch configurations can be created, modified, and deleted.

    NOTE: Selecting Run... from the Run menu or Run drop down menu has the same effect.

  2. Select Java Application in the left hand list of launch configuration types, and press New. This will create a new launch configuration for a local Java application. The newly created launch configuration will be populated with default values for launching the selected resource in the workbench (if any).
  3. 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 the Main class field.

    NOTE: A project does not have to be specified, but when a project is specified, it is used to calculate a default classpath, source lookup path, and JRE used to run or debug the application.

  4. The Arguments tab defines the arguments to be passed to the application and to the virtual machine (if any). As well, the working directory to be used by the launched application can be defined here.

  5. The JRE tab defines the JRE used to run or debug the application. This tab allows you to select from the already defined JREs, and allows you to define new JREs.

  6. 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. However, these settings may be overridden if required.

  7. The Source tab defines the location of source files used to display source when debugging a Java application. By default, these settings are derived from the associated project's build path. However, these settings may be overridden if required.

  8. The Common tab defines the location of the launch configuration itself. By default, a launch configuration is stored as a file, locally with the workspace meta data. However, a launch configuration may also be stored as a file in the workspace. This tab also controls which perspective becomes active when the launch configuration is launched in run or debug mode.

Related concepts

Debugger
Local debugging

Related tasks

Changing debugger launch options
Running and debugging

Related reference

Debug preferences
Debug view
Run and debug actions

 
 Copyright IBM Corporation 2000, 2002. All Rights Reserved.