I am trying to figure out which JAR libraries, out of a total of 83 JARs, are actually being used by a group of 12 Java EE/Spring projects. All JARs are under one EAR. Development is done in Eclipse and the build tool is Ant. All projects run on WebSphere Application Server 6.0.
This question: How to figure out used JARs?
points to this one: How to analyse which jar file is used in a Java program?
which recommends invoking the java
executable with the -verbose:class
argument, but if this would be useful here, how do I do this in the case where the projects are running on my local WAS 6.0?
This question seems to point more in the right direction: How to find which jars and in what order are loaded by a classloader?
However, I'm not familiar with how a class loader works, how to tell what my class loader instance is (a reply indicates that URLClassLoader has a getURLs()
method that provides access to a list of jars/directories), and if my class loader instance is not URLClassLoader, where do I go from there?