The jarg makes smaller a jar file in whitch java classes are stored.(To Japanese)
O 2003/01/29 : version 0.9.14 release.
+1. NEW : The function to remove unused classes was added. +2. NEW : The function to remove unused interfaces was added. +3. FIX : In cases where the method did not return a value and have 'if' statement with 'or' expression, the fault which generates an unsuitable byte code was corrected. ((Operating normally.) If this fault occurs, it stops)
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.
jarg read class files from a jar file, and analyzes the class files, performs the following processings, and outputs a compression jar file.
If jarg is used, there are the following effects.
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
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>.
Please download from sourceforge. The newest version is displayed on around the middle.
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.
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)
A change history should look at here.