Java programs may be launched in either run or debug mode.
1. |
In the Packages view, select the Java compilation unit or class file. |
2. |
If you want to debug the program, click the Debug button in the workbench toolbar. Otherwise, click the Run button. |
3. |
If you have not already set a launcher for the project, you will be prompted for a launcher to use. See Setting the Launcher for a projectNote: You can set the selected launcher as the default for future launches in the project by checking the Set as default launcher for project... checkbox in this dialog. |
4. |
If you selected a Java program, your program is now launched in the mode you selected, and the launch appears in either the Debug view (if launched in debug mode) or the Processes view (if launched in run mode). If you selected a Java project, you are prompted to select the class you wish to launch. Only those classes that define a main method are available to select. The chosen class is launched in the mode you selected. |
It is also possible to launch a program without first selecting it in the Packages or Navigator view. For example, if the active editor is open on the program you wish to launch, you can click the Run or Debug button.
You may also launch a program using a different launcher without having to change the default launcher for a project.
To do this, select a program or project in the Packages view, then activate the drop-down menu from the Run or Debug button. Select the Run or Debug submenu to see a list of all launchers available for the chosen mode.
Launching with a Non-Default Launcher