This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse: show used libs of project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse: show used libs of project" Watch "Eclipse: show used libs of project" New topic

Eclipse: show used libs of project

manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308

i am looking for following eclipse-capability:
select a projekt and show me all the libraries (jars), my sources are using indeed.

this way i want to clean up unused and therefore unneccessary library imports into the classpath. i think this must be somehow included in eclipse IDE, because it should not be to tricky to be realized (browse all my sources and analyze imports and compare with types in included libraries.

of course this would not be completely reliable because you always can hack this static typing with reflection. but at least it would be a help to find dead library imports.


aldana software engineering blog & .more
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16473

Within an error-free Eclipse project, you can simply go to the builder page and remove JARs from the project one by one. Each missing jar with static usage will cause the java source file decorators to light up (the white "X" in the red circle), which will be an indicator that you should put it back.

Or you can remove all the jars and just keep adding back until all the errors go away. I've done this from time to time.

Once you've cleaned the list of jars from your project, you should be able to go into the physical library directories and delete the jar files.

I do recommend you archive the project before you do this, though!

Customer surveys are for companies who didn't pay proper attention to begin with.
manuel aldana
Ranch Hand

Joined: Dec 29, 2005
Posts: 308
yes, know how to it manually but hoped that there was an automatic help of eclipse... something similar to unused import -> unused libraries.
rocket mass heater kickstarter
subject: Eclipse: show used libs of project