Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Determine which JARs are Used in an Application

Tags:

java

jar

An existing application has a ton of JAR files in its classpath. Someone must have added all JARs initially just to be sure. Some of the JARs were obviously not being used and we've already removed some of these unneeded JARs without causing any problems.

How does one determine which JARs are being used and which ones are unneeded (besides a trial and error method)?

like image 659
Aleks Felipe Avatar asked Nov 19 '10 06:11

Aleks Felipe


1 Answers

Tattletale is a great tool for this. It works on the bytecode, so it is possible, that some classes are use via reflection and will not come up in the report.

Here (link no longer works) is an example report. As you can see, you just have the feature you are looking for "Unused JAR".

like image 139
michael.kebe Avatar answered Sep 28 '22 09:09

michael.kebe