Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I guess that "remove them one by one and check if the application still compiles and works" is not the expected answer :)</p> <hr> <p>(EDIT: While the approach suggested above can be a bit automated, it remains somehow painfull and there must be an alternative, at least for compile-time dependencies. After some googling, I found <a href="http://www.kirkk.com/main/Main/JarAnalyzer" rel="nofollow noreferrer">Jar Analyzer</a> which seems to be a nice tool for this work as explained in this <a href="http://tfnico.blogspot.com/2009/04/reason-2-clean-up-your-jar-files.html" rel="nofollow noreferrer">blog post</a>:</p> <blockquote> <p>Jar Analyzer scans for compile dependencies, meaning that it can create a tree of which JAR-files are needed to compile which JAR-files that are needed to compile these JAR-files, and so on. You get a very nice report/graph which shows you all the JAR-files and why they are in there.</p> <p>You can also see the JAR-files that don't have any connection to your code, remove them and their children. What I found in our libs folder was that about 20% of the 150 JAR files in our libs folder were unused at compile time, and these were potential JARs to be removed.</p> <p><strong>The big aber is that you don't get any hint on which JAR-files are used only at runtime by means of discovery and reflection. And this is where the real work begins.</strong></p> <p>The only way to find out whether a JAR file is used at runtime is basically to take it out, start up your application and test every functionality. If you have an application of moderate size, performing a 100% regression test takes many hours. So in practice, I ended up doing alot of guessing, quick and dirty testing, and asking around to find out which of the runtime dependencies were actually in use.</p> </blockquote> <p>It seems pretty easy to use: download, unzip and run the tool on a directory containing all jars. Or use the provided Ant task.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload