Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

netbeans: how to determine unused JARs?

Tags:

java

jar

netbeans

Over the course of developing my Spring MVC project, I've accumulated an overabundance of JARs, many of which I suspect are no longer necessary.

I see that Eclipse has a plugin that can help find unused JARs. Is there an equivalent for Netbeans or something that works on the command line?

like image 817
Sajee Avatar asked Nov 29 '10 17:11

Sajee


People also ask

How do you remove unused jars?

Remove -> Test -> Remove -> Test -> Remove -> Hope you enjoy :) Change project to maven and select only jar you wanna use. For me this is the easiest way.

How do I generate a single jar file in NetBeans with dependency and libraries?

1) Click on Files tab on the left side of the project panel in NetBeans. 5) And here you done. Now you can go and check just like dist folder there will be a store folder which will be containing your final complete jar including all of your dependent libraries.


1 Answers

I don't think this can be done in a reliable way.

What if you have classes that are loaded via reflection? What if you have classes that are only referenced from within a Spring XML file?

They will never show up in the Java source code

like image 70
a_horse_with_no_name Avatar answered Sep 21 '22 01:09

a_horse_with_no_name