Defining the Main Class for J2EE modules
You can use the JAR Dependency editor to specify the Main Class
attribute in the manifest (MANIFEST.MF) for a module.
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.
To
define the main-class attribute for a J2EE module:
- In the Project Explorer view of the J2EE perspective, right-click
your project's MANIFEST.MF file, and select from the pop-up
menu. The META-INF file is located in the following locations for
the different module types:
EJB projects |
ejbModule/META-INF/MANIFEST.MF |
Application client projects |
appClientModule/META-INF/MANIFEST.MF |
Dynamic 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 JAR Dependency 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 dialog
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 Project Explorer
view.