tags:

views:

51

answers:

1

Is there a tool that can determine .jar dependencies given a directory of .jar files and a separate directory of java source code? I need to generate Eclipse .classpath files based on an existing code base that doesn't have any dependencies defined.

To be more specific, I've been given a large codebase consisting of a dozen or so J2EE-style projects and a single directory of jar files. My client uses a custom development and build framework that is just too arcane for me to use and get any real work done. The projects do not have any information about their dependencies, either between projects or to jar libraries.

I would expect this tool would have to spin through each jar file, indexing the classes available in that file and then go through each file in the project source code tree and match up the dependencies, possibly writing out a .classpath file with the required jar files. I realize this is a rather simplistic view of the operation, as duplicate classes among the jar files and such might make things more difficult.

+2  A: 

JarAnalyzer

Daniel
Sadly JarAnalyzer works with compiled code, not raw source. I've verified with the author of JarAnalyzer that his tool will not work for my needs. Just to be clear: I have a directory of raw, uncompiled source and I need to figure out which JAR files the source depends on.
geoffeg
Why don't you just compile the source? Don't you have all needed jar files?
Daniel
Yes, I have all the libraries and that's just the problem. I have X projects and they all use one or more JARs but I don't know which jars each project uses. Since the client wanted to split the projects up, I needed to know which project used which JARs.
geoffeg