IBM alphaWorks
E-Mail Site Map
Search

alphaWorks
Internet Access Required Internet Access Required alphaWorks Press and Awards Information about alphaWorks Internet Access Required XML Tutorials and Papers
JAX                                                                                                                                             | Overview | FAQ | Requirements | Discussion |

Update: [05/11/99]
New V5.3 includes a better version of reflect.


OVERVIEW
JAX, which is written in Java, is a Java application packaging tool that reduces the distribution size of a Java application. This means JAX collects the class files that comprise a given application and takes out only those elements in the class files that are not needed to execute the application. The result is a smaller "executable." With all optimization techiques currently done by JAX, an estimated 30%-50% reduction of the original application size is feasible.

JAX reads class files, analyzes them, and generates a compressed ZIP file as output, following this ordered procedure:
  1. Removal of dead methods and fields
  2. Detection of live overridden methods
  3. Removal of unused classes and interfaces
  4. Inlining of methods
  5. Removal of non-essential attributes
  6. Shortening of internal method names and field names
  7. Removal of non-used entries in the constant pool
After the above steps, JAX may use more aggressive compression techniques as well.


FAQ
  1. What is JAX? Why should I use it?

    JAX, which is written in Java, is a Java application packaging tool that reduces the distribution size of a Java application. This means JAX collects the class files that comprise a given application and takes out only those elements in the class files that are not needed to execute the application. The result is a smaller "executable." With all optimization techiques currently done by JAX, an estimated 30%-50% reduction of the original application size is feasible.

    JAX reads class files, analyzes them, and generates a compressed ZIP file as output, following this ordered procedure:

    1. Removal of dead methods and fields

    2. Detection of live overridden methods

    3. Removal of unused classes and interfaces

    4. Inlining of methods

    5. Removal of non-essential attributes

    6. Shortening of internal method names and field names

    7. Removal of non-used entries in the constant pool

    After the above steps, JAX may use more aggressive compression techniques as well.

    As a by product, a JAXed Java program is also obfuscated. Obfuscation makes the reconstruction of source code from byte codes difficult.

    You should use JAX if you want to reduce the size of your Java program or if you want to obfuscate it.

  2. Where is the documentation?

    The documentation is in HTML files in the directory jax\docs of the download package. The documentation consists of an executive summary, installation details, a tutorial, a reference manual, FAQs, news, and feedback.

  3. How do I use it? What command line options are supported?

    JAX takes as input the name of a Java class that represents the Java program whose size you want to reduce. Since JAX is written in Java, you run JAX the same way you would run any other Java program.

    The command line options that are supported are as follows:

        java jax [command_line_options] <class_name> [selected_package]

    where

      <class_name>
      starting class name

      selected_package (optional)
      the package of interest when loading the program

      command_line_options (optional) are:
      -nocompress
      do not compress constant pools
      -noobfuscate
      do not shorten names of internal classes, methods, and fields
      -notransform
      do not merge classes
      -noinline
      do not inline method class
      -simple
      use simple analysis (not RTA) to determine essential artifacts
      -noverify
      do not partially verify the compressed application
      -run
      run the application after compressing
      -runverbose
      run the compressed application (verbosely)
      -help
      show help information

    JAX generates two zip files, a log file, and a Windows batch file that facilitates running your compressed program on Windows NT or 95.

      <class_name>_big.zip is the uncompressed program
      <class_name>_jax.zip is the compressed program
      <class_name>_jax.log is the log file
      <class_name>_jax.bat is the Windows batch file

    JAX looks for two optional input files in the current directory:

      <class_name>_jax.dlc contains the names of all classes that are loaded dynamically
      Example:
          com.acme.ClassOne
          com.acme.ClassTwo
          com.acme.ClassThree
      <class_name>_jax.fcn contains the names of all classes whose name cannot change. Don't add any names already specified in the *_jax.dlc file. Furthermore, there is no need for an *_jax.fcn file when you specify the -noobfuscate option.
      Example:
          com.acme.ClassFive
          com.acme.ClassSiz
      <class_name>_jax.dim contains the names of all the methods that are called using reflection
      Example:
          com.acme.ClassFour specialMethod1 (I)V
          com.acme.ClassFour specialMethod2 (III)I
          com.acme.ClassFour (Ljava/lang/Object;)V

    Use the enclosed "methods" program to get a listing of available methods. Example:

    java methods java.lang.String

    Make sure that your CLASSPATH environment variable is correct. In particular, CLASSPATH must contains the path to jax33.zip. In addition, in some systems the CLASSPATH is case sensitive. In these systems please make sure the case sensitivity of CLASSPATH entries is maintained.


REQUIREMENTS
Click here to view the
Installation Procedures

JAX Platform Requirements
Operating System All Java-enabled platforms
Java Tools JDK 1.1/JRE 1.1


JAX Installation Procedures

  1. Download the JAX distribution zip file.

  2. Put the enclosed jax52.zip file in your CLASSPATH. Do not unzip this archive.

  3. If you have problems using the zip file, untar the enclosed jax52.tar file, and make class files accessible through your CLASSPATH.

  4. Follow the instructions in the JAX tutorial in the readme file.
File Size Comments  
jax53.zip 160 KB ZIP file containing JAX package.
jax53.tar 320 KB Tar file containing JAX 5.3
doc53.zip 96 KB ZIP file for JAX Version 5.3 documentation.
readme53 32 KB README file for JAX.
doc52.zip 73 KB ZIP file for JAX Version 5.2 documentation.
jax52.tar 320 KB Tar file containing JAX 5.2
readme52 0 KB README file for JAX.
jax52.zip 128 KB ZIP file containing JAX package.
jax50.zip 133 KB ZIP file containing JAX package.
Readme50 0 KB README file for JAX.
doc50.zip 109 KB ZIP file for JAX Version 5.0 documentation.
jax50.tar 330 KB Tar file containing JAX 5.0