With Eclpise (and other tools), it is possible to include a dependency jar inside another jar (see this answer). When Eclipse do that, it generates a custom class loader, because "classic" class loaders are not able to find a class in a jar that is inside another jar.
To create my jar (package.final.jar
), I :
- Imported the jar to include (dep.jar
) inside a libs/
folder in my project ;
- Added dep.jar
in MANIFEST.MF -> Runtime -> Classpath (so it added the line Bundle-ClassPath: libs/dep.jar,.
to my manifest) ;
- Exported my project as a deployable plug-ins and fragments.
And package.final.jar
contains only this structure :
-META-INF/MANIFEST.MF
-package/-class1.class
-class2.class
.
.
.
-libs/dep.jar
So I am wondering, where is the custom class loader created by Eclipse ?