Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding unused jars used in an eclipse project

Tags:

java

eclipse

jar

Are there any plugins/tools available to go through the classpath of an eclipse project (or workspace) and highlight any unused jars?

like image 674
RodeoClown Avatar asked Oct 29 '08 22:10

RodeoClown


People also ask

How do I remove a jar from a project?

Select Project in Project Explorer and Press "Alt+Enter" then Go to Java Build path and select Libraries then select jar file finally click on Remove button. select jar in the Project tree-view and right click on it and select Build Path then in select the Remove from Build Path . You are done.

What are JARs in Eclipse?

The Jar File wizard can be used to export the content of a project into a jar file. To bring up the Jar File wizard − In the Package Explorer select the items that you want to export. If you want to export all the classes and resources in the project just select the project.


1 Answers

ClassPathHelper is a good start.

It automatically identifies orphan jars and much more.

The only limitation is with dependencies that are not defined in classes, e.g. in dependency injection framework configuration files.

You also have other options/complements, such as:

  • workingfrog "Relief", which relies on the ability to deal with real objects by examining their shape, size or relative place in space it gives a "physical" view on java packages, types and fields and their relationships, making them easier to handle.
  • Unnecessary Code Detector: a eclipse PlugIn tool to find unnecessary (dead) public java code.
like image 139
VonC Avatar answered Sep 25 '22 18:09

VonC