Raheel
Raheel

Reputation: 5163

How can we find orphan jars in intellij idea project

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 ?

Upvotes: 7

Views: 2652

Answers (2)

Software Engineer
Software Engineer

Reputation: 16140

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.

Upvotes: 1

Anders R. Bystrup
Anders R. Bystrup

Reputation: 16080

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,

Upvotes: 3

Related Questions