You can import beans and other metadata from an EJB JAR file into
a new or existing EJB project.
To import an EJB
JAR file into an EJB project using the Import wizard:
- In the J2EE perspective, click File > Import > EJB JAR file and
click Next.
- In the EJB JAR file combination box, enter
the location and name of the EJB JAR file that you want to import. You can
click the Browse button to select the JAR file from
the file system.
- In the EJB Project combination box, type
a new project name or select an EJB project from the drop-down list.
- In the Target runtime drop-down list, select
the application server that you want to target for your development. If no
target servers exist, create one using the New button. The target server choice affects the run time settings by modifying
the class path entries for the project.
- Specify whether you want to add the new module to an enterprise
application (EAR) project.
- In the EAR application combination box,
type a new project name or select an existing enterprise application project
from the drop-down list. Or, click the New button to
launch the New EAR Application Project wizard.
Note: If
you type a new EAR project name, the EAR project will be created in the default
location with the lowest compatible J2EE version based on the version of the
project being created. If you want to specify a different version or a different
location for the enterprise application, you must use the New Enterprise Application
Project wizard.
- Click Finish to import the
EJB JAR file.
Tip: In the Project Explorer view you can also copy
enterprise beans by dragging and dropping them from one EJB project to another
EJB project. The import wizard will open to help you merge existing enterprise
beans.
Tip:
You can quickly drag
and drop an EJB JAR file from the Windows Explorer or desktop onto the
Project Explorer view. The Import wizard will open with appropriate fields
already populated. If you drop on an existing EJB module, the wizard will
import into that EJB module. If you drop on an enterprise application, the
wizard will bind the new EJB module to this EAR.