How JClass JarMaster Works

Whether you use JClass JarMaster's GUI, programmatic, or command line interface to build JARs, its most useful feature is that it can extract only the classes that your applet or application uses. You only need to tell it which main classes are used, and it will find all dependencies.

When you build a JAR for deploying your Java applet or application, determining which classes need to be included can be a troublesome task. Since most classes you create do not use all the classes in the packages that you reference, minimizing the size of the JAR means keeping track of, and including, only classes that are being used by your applet or application. While this may be easy if you are working with your own familiar packages, it can become quite cumbersome when dealing with third-party packages, whose contents are not as familiar.

   
  Figure 1: The fictitious myButton class uses only three of eight classes found in gui.elements.package.  

Even though choosing the entire package offers a quick solution, the result is an unnecessarily bloated distribution library, in which only a smaller number of the classes are actually being used.

The effects of this are felt when your application has been distributed, particularly on a Web page. The size of the JAR affects download time, which is something that should be minimized.

 
 
  Figure 2: Even though only three classes are used by your class, when it is archived in a JAR, all the classes from the referenced package will be included, unless you specifically exlude them.  

JarMaster solves this problem. It determines which package classes are referenced by your application's classes, then builds JARs based on these relationships (see Figure 3). Any unused classes in dependent packages are not included. This is done automatically, saving you the time and hassle of determining which classes to include, and resulting in an efficiently compact JAR.

   
  Figure 3: JClass JarMaster uses your myButton class to determine its dependencies and, accordingly, packages only those classes required in the distribution JAR.  

JClass JarMaster allows you to easily create JARs for your development projects. To create a JAR, simply specify which classes or packages are to be included, and JarMaster will automatically find their dependencies, based on your CLASSPATH settings or a search path that you specify. You can create JARs by using JarMaster's Swing-based GUI, programmatic interface, or from the command prompt.