2

I am currently working in an very old Java Eclipse project which has a lot of JARs linked to it's build path.

I have noticed that several of them aren't being used by the project any more, meaning old libraries that has been forgotten when the code has evolved over the years.

A standard way to determine if the library is used, is to simply remove it and see if there are any compilation errors.

However, I have noticed that some libraries in the build path are invoked by reflection, meaning if I remove the library I won't get any compilation errors. But the project will crash due to not finding the code anymore. Problem is you don't know when that can happen.

Is there a tool I can use to figure out which of all the linked JAR libraries I can safely remove, without getting compilation or reflection errors?

corgrath
  • 11,673
  • 15
  • 68
  • 99
  • possible duplicate of [Finding unused jars used in an eclipse project](http://stackoverflow.com/questions/248589/finding-unused-jars-used-in-an-eclipse-project) – Andreas Dolk Jul 01 '11 at 10:12
  • Be very careful. Unless you inspect all the code you cannot locate all the reflection points, and the application may crash a long time after being invoked because some rare code is being executed. – Thorbjørn Ravn Andersen Jul 01 '11 at 11:06
  • That's my biggest fear and I am hoping there is a clever tool that can help me. – corgrath Jul 01 '11 at 11:58

1 Answers1

1

Check ClassPathHelper.

abalogh
  • 8,239
  • 2
  • 34
  • 49