uk.ac.starlink.util
Class SuperJar

java.lang.Object
  |
  +--uk.ac.starlink.util.SuperJar

public class SuperJar
extends Object

Utility to generate a single jar file containing all the resources referenced by a given jar file. As well as the contents of the named jar file itself, the contents of any jar files referenced in the Class-Path line of that file's Manifest will be included, and so on recursively. This can be used to produce a standalone jar file for applications which do not require JNI components.

This class has a main method, and is designed to be invoked from the command line.


Constructor Summary
SuperJar()
           
 
Method Summary
static void main(String[] args)
          Writes a new jar file based on the contents of an existing jar file and the jar files referenced by its manifest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuperJar

public SuperJar()
Method Detail

main

public static void main(String[] args)
                 throws IOException
Writes a new jar file based on the contents of an existing jar file and the jar files referenced by its manifest.

Usage:

    SuperJar [-o outjar] [[-x exclude] -x exclude]..] jarfile [jarfile ..]
 

The -o flag may optionally be supplied to provide the name of the output jar file. Otherwise it will be given a default name (superjar.jar).

The -x flag may be supplied one or more times to define jarfiles which should not be included, even if they are referenced in the manifest's Class-Path entry of a jar file which is included. The exclude argument thus defined is the name, optionally with one or more prepended path elements of the jar file to be excluded (e.g. axis.jar or axis/axis.jar would both work).

The jarfile argument(s) will be combined to form the output file, all their contents and those of the jar files referenced in their Class-Path manifest entries will be used. The manifest of the first one will be used as the manifest of the output file (though its Class-Path entry will be empty).

Parameters:
args - an array of command-line arguments as described above
IOException

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.