Search code examples
javaeclipseclassloader

How to access the jar placed inside lib\ext directory in Eclipse?


I've made a jar library and places it inside jdk and jre's ext directory to check for installed extension scenario in Java.

Now when I a trying to create a Java project in eclipse and try to use the jar files classes or use the library, I am not able to access but those jar files are visible under Java PRoject jre system library in ECLIPSE.


Solution

  • You probably will have to specifically reference the jar in Eclipse. The colleciton of JARs that come with the JRE are also included in the manifest file so that the runtime knows which files to request be loaded. Since your jar is not in the manifest, it will not be loaded automatically.

    An alternative might be to repackage a JRE with an updated manifest that refers to your extension jar.