How to use the eclipse Jar-in-Jar Classloader in a non-eclipse project to load jars at runtime?

2.5k Views Asked by At

Eclipse allows in their export dialog to package the .jar files that a project depends on into a single resulting jar. Here you can see a example result:
Screenshot of the inside of a example jar.

How can I, as a non-eclipse user, take advantage of this functionality? In my case I must load jar files dynamically from the classpath into the classpath at runtime (I am creating an all-platform SWT application), so this technology would be perfect for me.

I already checked out all projects on maven central in the package org.eclipse.jdt, but none of the projects contains the relevant classes.

Is there a project somewhere that I can use to do this, as a non-eclipse user, and also in a non-jar (dev environment) context?

1

There are 1 best solutions below

2
On

Look at One-Jar: http://one-jar.sourceforge.net/

I used it for a bit, but found I could not easily use it for web start applications.