Reputation: 99
I have more than 200 libraries in my java web application due to which it takes much time to built and slow performance. do we have any tool or cmd for finding such unused libraries other than manual search from eclipse ?
Upvotes: 2
Views: 1502
Reputation: 1658
Add a JVM parameter -verbose:class to your server. This will log the jar files from which each class is loaded.
Deploy your web application and do a full test (to capture the classes that are loaded dynamically).
Capture the logs for individual jar files.
Remove the jar files that are not listed in the above step
Or you can use pom.xml with maven-dependency-plugin and find the unused jars.
Upvotes: 3