Automatic creation of Java archives
PrefaceCommand line versionEclipse plugin
Bernd Eggink, monoped@users.sourceforge.net Project page: SourceForge.net
Options
Options are prefixed by a hyphen. Several option characters may be combined, e.g. -vacpath instead of -v -a -cpath. Some options need an attribute, which can follow immediately or after a sequence of white space (e.g. -cpath or -c path).

Option Meaning
-h Print help and exit program.
-o outfile The archive to be created. This option is mandatory.
-c class path Class path in the ususal form (system dependent), used for for class look-up. The default value is ".".

The name part of each component may contain wildcards * and ?.

Example (Linux): Directory /foo contains the archives a.jar, b.jar, c.jar. The expression -c "/ah/oh:/foo/*.jar" will be expanded into

    -c /ah/oh:/foo/a.jar:/foo/b.jar:/foo/c.jar
The argument has to be quoted to prevent expansion by the shell.

Example (Windows): Directory C:\foo contains the archives a.jar, b.jar, c.jar. The expression -c C:\ah\oh;C:\foo\*.jar will be expanded into

    -c C:\ah\oh;C:\foo\a.jar;C:\foo\b.jar;C:\foo\c.jar
Several options -c are combined to a single class path;
    -c/usr/x:/sys/y -c /usr/z
is the same as
    -c /usr/x:/sys/y:/usr/z
-p filepath Search path for non-class files, same format as class path.
-b Use class path for non-class file lookup, too.
-m manifest The manifest file. Its content will be added to the generated MANIFEST.MF. If it contains a Main-Class: entry, the class name will be treated as if supplied on the command line.
-d Autojar scans the bytecode of all classes (except those from the JRE) for invocations of Class.forName() and issues correspondig warnings (see Reflection).
-a If Autojar finds an invocation of the kind Class.forName("name"), it tries to find and include the class name. Implies -d.
-A Autojar looks for calls like Class#getResource("name") or Class#getResourceAsStream("name"). If the parameter is a string constant, the resource file is looked up using the classpath, and if found, copied to the output. Implies -d.
-e All classes needed from archives in extension directories (system property "java.ext.dirs") are added to the output. Without this option, classes from an extension archive are copied only if the archive has been explicitly added to the class path (option -c).
-v Verbose mode.
-D Debug mode, print stack trace in case of errors. Normally not needed.
-q Be quiet. No output except errors.
-x prefix Prefix for files to be excluded. Archives and directories in the class path starting with prefix are ignored. Multiple declarations are allowed.
-- End of options. All subsequent parameters are treated as file parameters. This option is only necessary if the first file parameter starts with a hyphen.

up
Created 2011-05-10 by mopcoge