Right-click the project node in the Projects window and choose Project Properties.
Select the Run node in the Categories pane of the dialog box.
Type the fully qualified name of the main class in the Main Class field
(for example, org.myCompany.myLib.MyLibClass). The main class must
exist in the project or in one of the JAR files or libraries on the project's
runtime classpath.
If you use the Browse button to choose the project main class, the file
chooser only displays classes in your project source directory. If you
want to specify a class in one the libraries on the classpath, you have
to type the fully-qualified name of the class in the Main Class field.
Enter any runtime arguments you require in the Arguments field.
The
IDE sets the project's main class and stores any newly-added arguments.
For that have a main class is specified, the IDE automatically copies any JAR
files on the project's classpath to the dist/lib folder.
The IDE also adds each of the JAR files
to the Class-Path element in the application JAR's manifest.mf
file. This simplifies running the application outside the IDE. For more
information, see Preparing
a JAR for Deployment Outside the IDE