How to get Classpath for an EAR deployed in WebLogic Server

weblogicweblogic-10.xweblogic11g

I have an application deployed as an EAR in WebLogic 10.3.2 version. I am working on some implementations where I got to scan all of the .jar files in classpath.

At Runtime, when i call System.getProperty("java.class.path");, It returns me the WebLogic bootstrap classpath, NOT the one which my application is using within the EAR file.

Is there any way to the get the classpath which is being used by EAR file? I mean which is defined inside META-INF/MANIFEST.txt file.

Please advise and thanks in advance.

Raj

Best Answer

You can use this.getClass().getClassLoader().getResources("META-INF/MANIFEST.MF");

Or, if you need to load stuff, you should take a look into java.lang.ClassLoader.getSystemClassLoader(); and/or java.lang.Thread.currentThread().getContextClassLoader();.

Related Topic