Thanks Alvin for pointing to a nice discussion thread.
But I could not find a direct method in Instrumentation interface which could give me the list of Jars in Classpath. Only thing that I could see is some methods listing the classes already initialized/loaded.
Joined: May 25, 2011
Ah, I see.
Could you use System.getProperty("java.class.path") and then use a File to find all the jars there?
This returns the classpath of just the System class loader. It does not even list the JRE extension jars.
Consider an application running on a J2EE application server, where we will have classloader hierarchy extending the System Classloader.