Class Depends

Class depends is a simple tool which given a Java class will provide a complete list of Java jars which are required to make use of the class.

I've also added a dot file generator which generate dependency graphs for a given list of jar files. This also highlights circular dependencies between jar files.

Dependency graph for mx4j

Example of generated dependency graph, based upon jars from mx4j

The Code

Currently it lives in subversion here. You'll also need bcel from Apache. GraphViz is needed if you want to convert the dot graphs to images.

I've also put together an RPM and SRPM and a tarball for anyone else.

Usage

Resolving dependencies
classdepends [SEARCHCLASSPATH] [classname] ...
Generating dependency graph
classdot [jars] ...

The Future

My intention for the future of this tool is to extend it into a tool for dividing a list of classes up into sets to be placed into jars.

So given these classes

class CommonClass {}
class A extends CommonClass {}
class B extends CommonClass {}

Class depends would produce the following jars

A.jar: A.class
B.jar: B.class
Common.jar: CommonClass.class

Support/Contact

Got any questions, fixes or enhancements send them to Jeff