Class OneJarLoader

java.lang.Object
java.lang.ClassLoader
net.dryuf.onejarloader.OneJarLoader

public class OneJarLoader extends ClassLoader
The OneJarLoader implements ClassLoader which extracts the nested jar files and then allows loading classes and resources from them.

Either top level directory entries are scanned as dependencies or jar top level entries, including nested jars.

The ClassLoader supports native library with pattern os.name/os.arch/the-lib.ext and the-lib.ext

This code was written with Apache license to allow repackaging it together with commercial software.

Typical usage is as follows:

 public class JarMyApplication
 {
         public static void main(String[] args)
         {
                 OneJarLoader cl = new OneJarLoader();
                 cl.invokeMain(JarMyApplication.class.getName() + ".MyApplication", args);
         }
 }
 

VM parameters to configure logging: -DOneJarLoader.{Jar,Class,Native,Resource}.level={Level} Supported values are OFF, ERROR, WARN, INFO, DEBUG (default is ERROR)