Launching a Java Program

The simplest way to launch a Java program is to run it using a Java Application launch configuration. This launch configuration type uses information derived from the workbench preferences and your program's Java project to launch the program.

  1. In the Package Explorer, select the Java compilation unit or class file with the main method you want to launch.
  2. Press the Run [ The Run button ] button in the workbench toolbar or select Run > Run from the workbench menu bar. Alternatively, select Run As > Java Application in the Package Explorer pop-up menu, or select Run > Run As > Java Application in the workbench menu bar, or select Run As > Java Application in the drop-down menu on the Run tool bar button.
  3. Your program is now launched, and text output is shown in the Console View.

You can also launch a Java program by selecting a project instead of the compilation unit or class file.  You will be prompted to select a class from those classes that define a main method.  (If only one class with a main method is found in the project, that class is launched as if you selected it.)

Related concepts
Java views
Java editor
Debugger

Related tasks
Connecting to a remote VM with the Java Remote Application launcher
Re-launching a program
Running and debugging
Setting execution arguments
Stepping through the execution of a program

Related reference
Console View
Debug view
Package Explorer