Creating an enterprise application project in Eclipse (J2EE)

Enterprise application projects contain references to the resources needed for enterprise applications and can contain a combination of Web modules, JAR files, connector modules, EJB modules, and application client modules. An enterprise application project is deployed in the form of an EAR file, and is therefore sometimes referred to as an EAR project. The modules in an enterprise application project are mapped to other J2EE projects. The mapping information is stored in metadata files within the enterprise application project. The metadata files are used for exporting the project to an EAR file and for running the project on the server.

Like the other types of projects, enterprise application projects can contain one or more project facets, which represent units of functionality in the project. To be deployed as an EAR file, the new project must have the EAR facet. Depending on what you want to use the project for, you may want to enable other facets for the project.

When you create an enterprise application project, it is recommended that you do not give it a name that contains double-byte character set (DBCS) characters.

To create a J2EE enterprise application project:

1. In the J2EE perspective, click File > New > Project > J2EE > Enterprise Application Project.
2. In the Project Name field, type a name for the new project.
3. To change the default project location, clear the Use default check box under Project contents and select a new location with the Browse button.
4. In the Target runtime field, select the target runtime for the project. You can click the New button to create a new runtime for the project to use.
5. If you want to use a predefined configuration for your project, select a configuration in the Common Configurations list.
6. Click Next.
7. Select the check boxes next to the facets you want this project to have and select a version number for each facet. You can also choose a preset combination of facets from the Presets list, and you can also find out more about the requirements for each facet by right-clicking the facet name and then clicking Show Constraints.
8. If you want to limit your project so it will be compatible with one or more runtimes, click the Show Runtimes button and select the runtimes that you want the project to be compatible with.
9. Click Next.
10. On the J2EE Modules to Add to the EAR page of the wizard, select the existing modules that you want to add to the new enterprise application project.
11. You can also create new modules to add to the project:
1. Click the New Module button.
2. If you want to create one module, clear the Create default modules check box, select the type of module you want to create, click Next and follow the New Project wizard for that type of project.
3. If you want to create more than one module, select the Create default modules check box, select the check boxes for each type of project you want to create, and click Finish. You can enter a name for each module. Each of these modules will have the default settings for that type of project and they will have the same server target as the new enterprise application.
12. Click Finish.

Leave a comment