Running your programs
In this section, you will learn more about running Java programs in the workbench.
- In the Package Explorer view, find junit.textui.TestRunner.java
and double-click it to open it in an editor.
- In the Outline view, notice that the TestRunner class has an icon which
indicates that the class defines a
main
method.
- Using the drop-down Run button in the toolbar, select
Java Application from the cascading Run As
menu. This will launch the class in the active editor, or the selected class
in the Navigator, as a local Java application.
- Notice that the program has finished running and the following message appears in the
Console view telling you that the program needs an execution argument.
Running a program as a Java Application uses the default settings for
launching the selected class and does not allow you to specify any
arguments.
- To specify arguments, use the drop-down Run menu in the
toolbar and select Run....
- This time, the Launch Configurations dialog opens with the TestRunner launch configuration selected.
A launch configuration allows you to configure how a program is launched,
including its arguments, classpath, and other options. (A default
launch configuration was created for you when you chose Run as >
Java Application).
- Select the Arguments tab and type junit.samples.VectorTest in
the Program arguments area.
- Click Run. This time the program runs correctly, indicating
the number of tests that were run.
- Switch to the Debug perspective. In the Debug view, notice that a process
for the program launch was registered each time the program was run.
Note: You can relaunch any of these processes by selecting Relaunch
from its context menu.
- Select the drop-down menu from the Run button in the workbench
toolbar. This list contains the previously launched programs. These programs
can be relaunched by selecting them in the history list.
- From the context menu in the Debug view (or the equivalent toolbar button),
select Remove All Terminated to clear the view of terminated
launch processes.

Changing debugger launch options
Connecting to a remote VM with the Remote Java application launch configuration
Disconnecting from a VM
Launching a Java program
Running and debugging

Debug view
Run and debug actions