I've updated JarAnalyzer and fixed the bug (previously called a feature:-)) associated with running JarAnalyzer on a suite of .jar files that have cyclic dependencies. This makes the utility useful in helping to identify the cyclic dependencies between deployable units in your application. So I'm calling on all of you to run JarAnalyzer on your application. You can choose the .xml output, visual component diagram, or both (samples below). It will only take a few minutes, and the result will provide you with useful information. I'm also asking for some feedback from you.

First, share with me your results. How many .jar files compose your application? Does your application have cyclic dependencies? Second, give me your feedback on JarAnalyzer. Are there additional features you feel would be useful? What should be changed? Either send me an e-mail (remove the _filter), or post to this blog. I've detailed the steps to run JarAnalyzer below. And if by chance you encounter problems, please let me know. I'm interested.

Getting Started


Start by downloading JarAnalyzer. Unzip it to any directory on your harddrive. Assuming you have the JDK installed, JarAnalyzer is now ready to run. You have a few different options when running JarAnalyzer. Questions you have may be answered on the JarAnalyzer homepage.

Command line - xml output


Some examples of the xml output can be found on the JarAnalyzer homepage. Here's the xml output after running JarAnalyzer on Struts.
  • Go to command prompt, navigate to the directory where you unzipped JarAnalyzer, and type runxmlsummary.
  • Enter the name of the directory with your jar files, such as your web-inf\lib (ex. C:\Java Applications\JarAnalyzer\testfiles). You might also consider copying only the .jar files you want analyzed to a separate directory.
  • Enter the name of the output directory plus filename (ex. c:\jaranalyzer\out.xml).


  • Command line - component diagram output


    This is a two step process. To complete the second step, you need to have GraphViz installed. If you really don't want to (or possibly cannot) install GraphViz, you can still perform the first step. This will be useful if you are willing to send me your .grph file. Because I care, I'll run the second step for you to generate the visual component diagram. Here's the steps.
  • Go to command prompt, navigate to the directory where you unzipped JarAnalyzer, and type rundotsummary.
  • Enter the name of the directory with your jar files, such as your web-inf\lib (ex. C:\Java Applications\JarAnalyzer\testfiles). You might also consider copying only the .jar files you want analyzed to a separate directory.
  • Enter the name of the output directory plus filename (ex. c:\jaranalyzer\out.grph). This creates a .grph file. You can open and view it in any text editor. But the real useful part is that you can now use GraphViz and dot to create your visual component diagram.
  • To run GraphViz, you have to first install it. Once installed, run dot on the output file (out.grph). (ex. dot -Tpng -Nshape=box -Nfontsize=30 -Nwidth=1.5 -Nheight=1.25 out.grph -o out.png). This will produce an image showing the relationships between your application .jar files. Here's an example showing Struts and it's dependencies.


  • Incorporate into your build process


    If you have an automated and repeatable build process, you can incorporate JarAnalyzer into this process with relative ease. Again, if you want the visual component diagram as output, you'll need to have GraphViz installed. I have setup two samples on the JarAnalyzer homepage showing how to generate the xml output, as well as generating the dot output.

    Please, give me your feedback!