Reputation: 5730
I've a very big project where thousands of classes are using 100s of third party jars.
I need to find out list of jars used by every single class in the project for compilation as well as during execution, i.e. runtime.
How can I achieve it? It is difficult to manually inspect this many classes so I would prefer some Eclipse/IntelliJ IDEA plugin which can give me a report or any type of script that can create list of classes vs jars used.
Thanks.
Upvotes: 1
Views: 1043
Reputation: 927
I suggest you add -verbose:class
to your java command execution. This will emit any class being loaded during runtime, and the jar it was loaded from. Unlike the code analysis tool from IntelliJ, this method will also work for classes loaded using reflection.
Upvotes: 0
Reputation: 83
You can do that with IntelliJ IDEA. It's really simple. From the main menu, select Code -> Analyze Code -> Dependencies
Then select Whole Project and press Analyse
Finaly a window open at the bottom of IDEA and on the right side you can see all dependency used in the project.
All you have to do is navigate in your project (left part) and click on the class for which you want to know the dependency used ;)
PS: You can also Analyse only one classe to see all the dependency she used, by usong the custom scope (just select your classes)
Upvotes: 1