Take the 2-minute tour ×

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?

share|improve this question
possible duplicate of Finding unused jars used in an eclipse project –  Andreas_D Jul 1 '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 1 '11 at 11:06
That's my biggest fear and I am hoping there is a clever tool that can help me. –  corgrath Jul 1 '11 at 11:58
add comment

1 Answer

up vote 1 down vote accepted

Check ClassPathHelper.

share|improve this answer
Does that check for reflection points as well? –  corgrath Jul 1 '11 at 11:58
No, and I don't think it's even theoretically possible using a static code analyzer. –  abalogh Jul 1 '11 at 12:07
add comment

Your Answer


