AS400ToolboxJarMaker

While the JAR file format was designed to speed up the downloading of Java™ program files, the AS400ToolboxJarMaker generates an even faster loading IBM® Toolbox for Java JAR file through its ability to create a smaller JAR file from a larger one.

AS400ToolboxJarMaker class

Also, the AS400ToolboxJarMaker class can unzip a JAR file for you to gain access to the individual content files for basic use.

Flexibility of AS400ToolboxJarMaker

All of the AS400ToolboxJarMaker functions are performed with the JarMaker class and the AS400ToolboxJarMaker subclass:

According to your needs, you can invoke the AS400ToolboxJarMaker methods from within your own Java program or from a command line. Call AS400ToolboxJarMaker from the command line by using the following syntax:

     java utilities.JarMaker [options]

where

For a complete set of options available to run at a command line prompt, see the following:

Using AS400ToolboxJarMaker

You can use AS400ToolboxJarMaker to work with JAR files in several ways:

Uncompressing a JAR file

Suppose you wanted to uncompress just one file bundled within a JAR file. AS400ToolboxJarMaker allows you to expand the file into one of the following:

For example, with the following code, you are extracting AS400.class and all of its dependent classes from jt400.jar:

    java utilities.AS400ToolboxJarMaker -source jt400.jar
        -extract outputDir
        -requiredFile com/ibm/as400/access/AS400.class

Splitting up a single JAR file into multiple, smaller JAR files

Suppose you wanted to split up a large JAR file into smaller JAR files, according to your preference for maximum JAR file size. AS400ToolboxJarMaker, accordingly, provides you with the split(jarFile, splitSize) function.

In the following code, jt400.jar is split into a set of smaller JAR files, none larger than 300KB:

    java utilities.AS400ToolboxJarMaker -split 300

Removing unused files from a JAR file

With AS400ToolboxJarMaker, you can exclude any IBM Toolbox for Java files not needed by your application by selecting only the IBM Toolbox for Java components, languages, and CCSIDs that you need to make your application run. AS400ToolboxJarMaker also provides you with the option of including or excluding the JavaBean files associated with the components you select.

For example, the following command creates a JAR file that contains only those IBM Toolbox for Java classes needed to make the CommandCall and ProgramCall components of the IBM Toolbox for Java work:

     java utilities.AS400ToolboxJarMaker -component CommandCall,ProgramCall

Additionally, if it is unnecessary to convert text strings between Unicode and the double byte character set (DBCS) conversion tables, you can create a 400KB byte smaller JAR file by omitting the unneeded conversion tables with the -ccsid option:

     java utilities.AS400ToolboxJarMaker -component CommandCall,ProgramCall -ccsid 61952
Note: Conversion classes are not included with the program call classes. When including program call classes, you must also explicitly include the conversion classes used by your program by using the -ccsid option.