Enable EJB support
You can enable EJB support when creating a new project or module. You can also add the EJB support for an existing module.
Enabling EJB support when creating a project or module
Do one of the following:
If you are going to create a new project: click Create New Project on the Welcome screen or select File | New | Project.
As a result, the New Project wizard opens.
If you are going to add a module to an existing project: open the project to which you want to add a module, and select File | New | Module.
As a result, the New Module wizard opens.
On the first page of the wizard, in the left-hand pane, select Java Enterprise. In the right-hand part of the page, specify the JDK to be used and select the Java EE version to be supported.
Under Additional Libraries and Frameworks, select the EJB: Enterprise Java Beans checkbox.
- Select the EJB version to be supported from the Versions list.
If you want an EJB deployment descriptor file ejb-jar.xml to be created, select the Create ejb-jar.xml checkbox.
Select the required library option and, if necessary, specify the associated settings. You can choose to:
- Download and use an EJB library.
To do that, under Libraries, select Download.
Now, to view or modify the associated options, click Configure, and in the Downloading Options dialog that opens:
Specify the library name.
Select the library level (global, project, or module).
Under Files to download, select which of the files you want to download.
Under Copy downloaded files to, specify the path to the destination folder. If you want to change the default path, click and specify the folder location in the dialog that opens.
- Use an EJB library IntelliJ IDEA is already aware of.
To do that, click Use library and select the required library from the list.
If necessary, configure the library settings (for example, change its name). This is done in the Edit Library dialog which you can open by clicking Configure.
- Create a new library using the appropriate JAR files available on your computer.
To do that, click Use library and then click Create. Select the required JAR files in the dialog that opens. (For multiple selection, keep the Ctrl key pressed.)
If necessary, configure the new library (for example, change its name or level ). To do that, click Configure and specify the required settings in the Create Library dialog.
Postpone setting up the library until a later time. In this case, select Set up library later.
Click Next.
- Download and use an EJB library.
Specify the name and location settings.
Click Finish.
Enabling EJB support for an existing module
Open the Project tool window (e.g.
).Right-click the module and select Add Framework Support.
- In the left-hand pane of the Add Frameworks Support dialog, select the EJB: Enterprise Java Beans checkbox.
Select the EJB version to be supported from the Versions list.
If you want an EJB deployment descriptor file ejb-jar.xml to be created, select the Create ejb-jar.xml checkbox.
Select the required library option and, if necessary, specify the associated settings. You can choose to:
- Download and use an EJB library.
To do that, under Libraries, select Download.
Now, to view or modify the associated options, click Configure, and in the Downloading Options dialog that opens:
Specify the library name.
Select the library level (global, project, or module).
Under Files to download, select which of the files you want to download.
Under Copy downloaded files to, specify the path to the destination folder. If you want to change the default path, click and specify the folder location in the dialog that opens.
- Use an EJB library IntelliJ IDEA is already aware of.
To do that, click Use library and select the required library from the list.
If necessary, configure the library settings (for example, change its name). This is done in the Edit Library dialog which you can open by clicking Configure.
- Create a new library using the appropriate JAR files available on your computer.
To do that, click Use library and then click Create. Select the required JAR files in the dialog that opens. (For multiple selection, keep the Ctrl key pressed.)
If necessary, configure the new library (for example, change its name or level ). To do that, click Configure and specify the required settings in the Create Library dialog.
Postpone setting up the library until a later time. In this case, select Set up library later.
- Download and use an EJB library.
Click OK in the Add Frameworks Support dialog.