This tools allows creating jar files that includes only classes actually used by the main program.


jar -jar plex.jar -j jar-file -p [list of package-names separated by comma to include] list-of-main-classes

Where -j specifies output jar file
-p specifies list of package names separated by comma (without any spaces). The PlexJar will include classes only if their package names match with this list.
list of class names will be your list of your initial or main classes that invoke all other classes.

By default PlexJar does not include any classes with package names that start with:

  • java.
  • javax.
  • sun.
  • com.sun.
  • org.omg.
If you wish to change this list then specify System property named DISALLOWED_PACKAGES to include list of package prefixes separated by comma (without spaces).

For example

java -cp plexjar.jar:$CLASSPATH com.plexobject.util.SlimJar -p com.plexobject -j test.jar mypackage.mymainclass


You need JRE 1.2 or newer to use this software. The latest version of JRE can be download from

License Agreement:

| Agree