I have found useful tools to do this in eclipse like Classpath Helper, but is there any plugin or way in intellij idea to find unused jar files ?
In IntelliJ IDEA, we can press on the keyboard SHIFT key twice to open a search everywhere windows to quickly find a class or a file. Other shortcuts, seldom use, prefer double clicks on SHIFT key to open the search windows. Ctrl+N – finds a class by name. Ctrl+Shift+N – finds a file or directory by name.
File > Project Structure... or press Ctrl + Alt + Shift + S. Project Settings > Modules > Dependencies > "+" sign > JARs or directories... Select the jar file and click on OK, then click on another OK button to confirm. You can view the jar file in the "External Libraries" folder.
I'm sure you know how to use the IDEA Dependency Analysis tool to find library dependencies, and while that could get you some of the way it's of course not enough.
The problem and fact is that there is no way of finding unused JARs by way of static analysis, since it is possible to refer to and create any class in any dependency by way of reflection/IoC/whatnot these days.
So, the best you can "hope" for is a tool that can tell which JARs are not explicitly referenced by your code - curiously that is absent from IDEA as far as I know (but I would love to be corrected on that point!)
Cheers,
You should really be using maven and determining each module's dependencies manually. Classpath Helper is an astonishingly bad way to tell what jars you're using.
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