In our application through the process of developing a lot of JAR files has been collected. How can I filter out those, which are not used by application anymore? On some easy way?
If you are sure your you can exercise your application so that it uses all it's jars, you can create a simple perl script:
while (<>) {
$l{$1}++ if m/\s+from\s+(.+\.jar)/;
}
for $l (keys(%l)) {
print "$l\n";
}
(lets name it list_jars.pl) and feed it the output of a verbose run:
java -verbose -jar YOUR_APP.jar | perl list_jars.pl
which should list all sources of classes loaded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With