Issue
I have some jars in my project. I want to know how these jars are used or what the effects will be if I remove them?
Solution
You can achieve it using loosejar.
It is a simple Java Agent that can be used to discover unnecessary jars lying on application classpath. It performs per classloader JVM heap analysis and displays its results. loosejar can be safely used during development, QA, UAT or even in production as it doesn't modify the state of the JVM at all and adds no overhead.
How to use:
Start your application or application server with -javaagent:loosejar.jar flag (loosejar.jar should obviously point to the correct path of the actual jar)
Exercise your application to make sure that the classes get loaded into the JVM.
Get loosejar analysis results via JMX console (open jconsole and run com.googlecode.loosejar.LooseJarMBean#summary() in MBeans folder) or on application shutdown (via regular console log).
Answered By - Ankur Lathi