IntelliJ IDEA provides a dedicated EJB facet to support EJB technology. If you need to enable EJB in a module, you have to extend this module with the EJB facet that corresponds to the desired specification. If a new module is being created from scratch, it is possible to enable EJB support in the Add Module wizard. If a module already exists, the EJB facet should be added in the Modules Settings dialog box.
Multiple EJB facets are allowed in a single module.
Create a new Java module from scratch.
- On the Technologies page of the wizard, select the Enterprise JavaBeans check box.
- From the drop-down list, select the desired EJB specification.
- Click Finish.
- Open the Module Settings dialog box.
- With the desired Java module selected, click on the toolbar, and select
EJB from the list of facets available for this module.
As a result, a new EJB facet is created. Its settings are shown on the EJB Facet page in the right-hand part of the dialog.
If necessary, create deployment descriptors:
- To create a standard EJB deployment descriptor (ejb-jar.xml), click (Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+Insert or Ctrl+NAlt+InsertCommand N or Control EnterControl N or Control EnterCommand N or Control Enter) in the Deployment Descriptors area, select ejb-jar.xml and specify the descriptor location and version in the dialog that opens.
- To create an application server-specific deployment descriptor, click Add Application Server Specific Descriptor and specify the descriptor properties in the dialog that opens.
Use (EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter) or (Alt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteAlt+DeleteCommand Delete or Command BackspaceCommand DeleteCommand Delete or Command Backspace) to edit or delete selected deployment descriptors.