You can use the manifest editor
to specify the Main Class attribute in the manifest (MANIFEST.MF)
for a module.
About this task
The Main Class attribute in
the MANIFEST.MF file specifies the Java™ class of the application entry point. This attribute is
typically used for application client modules. For application client
modules, the main class attribute is also displayed on the Overview
page of the Client Deployment Descriptor editor.
Procedure
- In the Enterprise Explorer view of the Java EE perspective, right-click your project's
MANIFEST.MF file, and select from the pop-up
menu. The MANIFEST.MF file is located in the following
locations for the different module types:
| Project type |
Location of manifest file |
| EJB projects |
ejbModule/META-INF/MANIFEST.MF |
| Application client projects |
appClientModule/META-INF/MANIFEST.MF |
| Web projects |
WebContent/META-INF/MANIFEST.MF |
| Connector projects |
connectorModule/META-INF/MANIFEST.MF |
Tip: For application client modules, you can also
click Edit in the Main Class section of the
client deployment descriptor editor to launch the Manifest Editor.
- In the Dependencies page of the editor, scroll to the Main
Class section and choose from the following options:
- Type the package name and file name for the main class.
- Click Browse to use the Type Selection
window to locate the main class.
- Click Create to use the Create Java Class wizard to create a new
main class.
- Click Remove to remove the current
definition for the main class. Clicking Remove does not delete the actual Java class. You can remove it manually in the Enterprise Explorer view.