Community articlePackaging extensions as JAR Files
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Once you have created your extensions you can package the .class files into a single Java Archive (JAR) file and distribute the file. This means that you can package multiple extensions into one JAR file for distribution.
Before building the JAR file, you must create a manifest that indicates which classes in the JAR file are extensions.
  1. Using your favorite text-editor, create a manifest file for the extensions you wish to package in the JAR file.
    • The manifest file has the file extension .mf. For example, the manifest file for FCIExtension is called:

    • The first line of the manifest must include the manifest-version number. See the following example for the correct syntax.
    • The manifest file is broken down into sections, where each section represents a particular Extension class and its attribute as an extension.
    • The class listed in each section of the manifest file is the class that implements the Extension interface. In the following example FCIExtension.class implements FCIExtension.
    • For example, the manifest file for FCIExtension will have the following syntax and format (notice that there is a space after every colon)
    •       Manifest-Version: 1.0
            Name: com/yourcompany/samples/FCIExtension.class
            IFS-Extension: True

    • Ensure that you add a carriage return to the last line of the manifest file. Otherwise the JAR may not work properly.
  2. Create a JAR file from the .class files that make up your extension.
    • Use the following syntax to create the JAR file:
    •       jar -cvfm destination.jar YourExtension.class 

    • Optionally, you can replace the class names with the root folder for your package. This will include all classes that are defined in that package. For example, to create a JAR file called FormIFX for FCIExtension, you would type the following:
    •       jar -cvfm FormIFX.jar com