Specifying the Main Class to Run for a Project

To run a program from within the IDE, you must specify the main the Java class file, or starting point, of your project. If you create a project from a template, you are prompted to specify the main class the first time you compile the program. You can also set the main class using the Project menu in the main window.

To specify the main class for the current project:

  1. From the main window, choose Project Set Main Class (Ctrl-Shift-M).

  2. In the Select Main Class dialog box, select the class that contains the main method.

  3. Click OK.
See also
Compiling, Running, and Debugging a Project

Legal Notices