Specifying dependent JAR files or modules
You can use the Java™ EE Module Dependencies wizard to specify JAR files or modules that are required by a module. The dependencies are defined in the MANIFEST.MF file for your module.
When you are specifying required JAR files or modules, you first specify the enterprise application (EAR) that your project is a part of. Usually, the project will be referenced by one EAR project in the workspace. However, it is possible that you will have multiple enterprise applications that contain a reference to the same module or utility JAR project. If this is the case, then you should ensure that you give the JAR or module the same Uniform Resource Identifier (URI) in each application, so that the class path will be valid for all applications.
It is also possible that your module is a standalone project and is not currently referenced by any enterprise application. In this case, since there is no enterprise application scope defined, you cannot use the JAR Dependency editor to update the dependencies. To add the module to an enterprise application, see Adding modules to an enterprise application.
To specify the JAR files or modules in an enterprise application that are required by a module, complete the following steps:
- In the Enterprise Explorer view of the Java EE perspective, right-click your project file, and select
Properties. On the Properties page, select
Java EE Module Dependencies. If you have a deployment descriptor, you can open
Java EE Module Dependencies by clicking on the Manage Utility Jars link on the bottom of the deployment descriptor page.
- Click OK.
Tip: If you need to compile against a server's runtime JAR files during development, you do not need to add these JAR files as dependent JAR files. The workbench manages this by using the target server property for the project. The workbench adds the appropriate libraries to your project's build and class path based on the target server. For more information, see Specifying target servers for J2EE projects.
Related concepts
Application Deployment Descriptor editor