public void main (EntryPointConfiguration config) throws Throwable {
URL boot = EntryPoint.class.getClassLoader()
.getResource("META-INF/net/sf/javautil/boot.jar");
ClassContext context = null;
CompositeClassSource mainSource = new CompositeClassSource();
ClassSource additional = this.getAdditionalClassSources();
if (additional != null) mainSource.add(additional);
if (boot != null) {
mainSource.add( VirtualDirectoryClassSource.createInMemoryJar("boot", "main", boot.openStream()) );
context = new ClassContext(new StandardClassLoaderHeiarchy(Thread.currentThread().getContextClassLoader()), mainSource);
} else {
String main = this.getSetting(MAIN_JAR_PROPERTY);
if (main == null)
printHelp("No internal uber jar and no main jar specified -D" + MAIN_JAR_PROPERTY + "=''");
File mainFile = new File(main);
if (!mainFile.exists())
printHelp("Specified main jar does not exist: " + mainFile);
mainSource.add( new ZipClassSource(mainFile) );
context = new ClassContext(new StandardClassLoaderHeiarchy(Thread.currentThread().getContextClassLoader()), mainSource);
}
Thread.currentThread().setContextClassLoader(context);
this.setupDefaultURLStreamHandlerFactory(context);
String mainClassName = null;
if (mainClassName == null) {
Manifest manifest = mainSource.getManifest();
if (manifest == null)
printHelp("No main jar manifest found in " + mainSource);
mainClassName = manifest.getMainAttributes().getValue("Main-Class");
}