Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I identify unnecessary jars included in my project?

Tags:

java

jar

I'm working in a Java project where the axis 2 library from Apache is being used. The axis 2 library is composed of about 20 jar files and some of these are not used project. What I want to know if there is a method to identify which of those jar files are the unused ones.

I'm using the Eclipse IDE an I thought that one way to solve the problem is to add one jar at time until the I get no error messages about the missing classes. However, I'm not sure if this will work as some of the missing classes errors show up only at runtime.

Does anyone know a better way to solve this problem?

like image 628
Alceu Costa Avatar asked Feb 28 '23 15:02

Alceu Costa


1 Answers

tattletale FTW

http://www.jboss.org/tattletale

JBoss Tattletale is a tool that can help you get an overview of the project you are working on or a product that you depend on.

The tool will provide you with reports that can help you

  • Identify dependencies between JAR files
  • Spot if a class is located in multiple JAR files
  • Spot if the same JAR file is located in multiple locations
  • With a list of what each JAR file requires and provides
like image 79
alamar Avatar answered Mar 23 '23 10:03

alamar