jarg - Java Archive Grinder

The jarg makes smaller a jar file in whitch java classes are stored.(To Japanese)


from 2001/04/02
SourceForge Logo JARS Logo


Current Version : 0.9.14 --Release Date : 2003/01/29 -- DOWN LOAD


News

O 2003/01/29 : version 0.9.14 release.


What is jarg ?

The jarg reduces the size of a jar file in which java class files are stored. "Size curtailment can be carried out simply" is the 1st target. However, as a result of processing by jarg, since a Java class file is optimized, it becomes quicker, and since it is renamed, it becomes that it is harder to be analyzed. That is, jarg is 'Java Optimizer', and it is 'Java Obfuscator' and is also 'Java Shrinker' or 'Java Reducer'.

Finally, jarg is 100% Pure Java, and an open source, and you can use it for free.

How does jarg operate?

jarg read class files from a jar file, and analyzes the class files, performs the following processings, and outputs a compression jar file.

What is the effect which used jarg ?

If jarg is used, there are the following effects.

Can jarg be performed in my environment ?

In order to perform jarg, Java2 compatible JVM is required. In addition, there is no required thing. Since my development environment is jdk 1.3.1_02/win2000, although a check of operation has not been carried out in except it, I think that it is satisfactory.

A report of operation: That it can be operating on i-Appri (DoJa1.0 2.0), Java-Appri (MIDP of J-Phone), and ezplus (MIDP of au).
> Thanks : potaka

About a license

You can use this software jarg freely no guaranteeing and for free. This software jarg is an open source, and can peruse a source code freely from the cvs server of sourceforge.

This software uses BCEL-The Byte Code Engineering Library (JavaClass) for operation of a Java class file.

When you use this software and the fault and the problem of this software are discovered, please connect to Hidetoshi Ohuchi <hchacha@users.sourceforge.net>.

Download and Installation

Please download from sourceforge. The newest version is displayed on around the middle.

jarg
It is a jarg main part. the following lsjar,spjar are mini tools. Please download together!
lsjar
It is the tool which displays the contents of a jar file. The contents of a Java class file can also be displayed.
spjar
It is the tool which divides a jar file into the jar file which collected only class files, and which can be performed, and the other jar file for resources.

If it downloads, please unzip it on the favorite directory. Installation is only it. That it is required for others has no setup of an environment variable etc.

Usage

Please move to a directory with a jar file to process by jarg. The rest is only used as follows at a command line.

 > java -jar jarg.jar abc.jar

Your a jar file to process by jarg is specified to be the place of abc.jar. After a while, abc_s.jar is created by the same place as abc.jar. It is the jar file to which this abc_s.jar was processed by jarg, and became smaller.

Still, since there may be a bug, please fully check that abc_s.jar is performed and there is no fault.

If it is performed as follows, a command line help will be displayed.

  > java -jar jarg.jar
  jarg - Java Archive Grinder (jarg) - ver 0.9.12
  [usage] java -jar jarg.jar {options} xxxx.jar
    options
        -version     : show version
        -verbose     : verbose mode
        -verbosern   : verbose of renaming
        -verboseufm  : verbose of removing unused fields and methods
        -verbosebco  : verbose of byte-code optimizing
        -verboseall  : verbose all
        -showstat    : show statistics
        -showtime    : show time
        -nocomp      : no commpressed output jar
        -normdir     : no remove directry entry in a jar file
        -normlv      : no remove local variable
        -normln      : no remove line number
        -normsf      : no remove source file
        -normsy      : no remove 'Synthetic'
        -normin      : no remove 'InnerClasses'
        -normex      : no remove 'Exceptions'
        -nornc       : no rename class
        -nornf       : no rename field
        -nornm       : no rename method
        -nobco       : no byte-code optimizing
        -excpp @file : list of excepting package
        -excpc @file : list of excepting class
        -excpf @file : list of excepting field
        -excpm @file : list of excepting method
        -rnlog file  : rename log file
        -j2me-prev preverify  : preverify command path
        -j2me-cp classpath    : preverify class path

In not changing a class name, it performs it as follows.

  > java -jar jarg.jar -nornc abc.jar

A class name not to change is put into a text file including a package name to change a certain specific class name. When there are more than one, each is divided by new-line so that it may become one class name at one line. And it is performed as follows. Here exclass.txt is the name of the above-mentioned text file.

 > java -jar jarg.jar -excpc @exclass.txt abc.jar 

Please do it as follows on J2ME, since it is necessary to perform preverify again in the case of the jar file for J2ME-MIDLET.

 > java -jar jarg.jar -j2me-prev c:\j2mewtk\bin\preverify.exe -j2me-cp c:\j2mewtk\lib\midpapi.zip abc.jar

Since it support for Ant Task , direct use can be carried out in an Ant build file. (sample & options)


Change History

A change history should look at here.