JAR dependency editor

The JAR dependency editor updates the manifest class path for a utility JAR or module in an enterprise application. The Java build path is updated accordingly for the containing project. It also sets the Main-Class attribute of the manifest, which is typically only used for application client modules.

The JAR dependency editor consists of the following pages and sections:

 

Dependencies page

The JAR dependency editor is designed for classpath editing. Therefore, not all of the attributes or information contained in the manifest file (MANIFEST.MF) are represented in this topic.

Class path Scope section

Use this section to select the enterprise application to use for class path editing. The list will contain all enterprise applications which contain a reference to the current project as a module or utility JAR. Use the Refresh button to update the list if a change is made in a separate editor.

Dependencies section

Use the Dependencies section to select other JAR files or modules contained by the enterprise application that are required by the JAR file or module you are currently working with. You will see existing class path entries in the manifest file, and all available, valid entries in the selected application in the preceding section.

In cases where your module depends on an EJB module that has an EJB client JAR file, you can choose whether you want to depend on the EJB JAR file or the EJB client JAR file. If you select the Use EJB JARs radio button, the table will not show any EJB client JAR files. If you select the Use EJB client JARs radio button, the table will not show any EJB JAR files that have corresponding EJB client JAR files. If you select the Allow both radio button, the table shows EJB JAR files and EJB client JAR files and allows you to select both types.

Tip: The Dependencies section automatically switches dependencies based on which radio button you select. For example, if you have a dependency set on an EJB JAR file and you select the Use EJB client JARs radio button, the dependency will switch to the appropriate EJB client JAR file. If you select the Allow both radio button, none of your dependency selections will change automatically.

Main-Class section

Use this section to set the main-class, or entry point, of the application. The Main-Class attribute specifies the Java class of the application entry point.

 

Source page

It should not be necessary to manually edit manifest files in J2EE projects. However, if you choose to manually edit these files, you should be aware of some common limitations from the Manifest Format specification:

For more information, refer to the official Manifest Format specification. The standard Java APIs are used for reading and writing manifest files.

Adding a directory to the MANIFEST.MF file

When you add a directory to the MANIFEST.MF file, you receive an error message like the one below:

    IWAE0024W The Manifest Class-Path for archive xyz.jar contains an entry,
    properties, that is not resolveable to a file or module in the EAR:
    sample... 
The EJB specification is not explicit on this issue. However, it does suggest that loose files within an EAR are invalid. Currently, this configuration does work in the WebSphere Application Server, but you should not rely on this configuration working in the future. You can create a Java project and add the property files to a source folder (or the project if the project is the source folder). On the Modules page of the application deployment descriptor editor, you can add this Java project as a Project Utility JAR, then you can run the EAR file in the WebSphere Test Environment. When you export the EAR file, the Java project will automatically be added to a JAR and included in the EAR.

 

Related concepts

Client Deployment Descriptor editor

 

Related tasks

Specifying dependent JAR files or modules
Defining the Main Class for J2EE modules