Skip to content →

Tag: reverse engineering

Generating UML diagram from Java source code

Sometimes we may need to generate UML diagrams from source codes. Here’s what I do for Java code: graphviz + ant + UMLGraph. Details below:

1. Install graphviz and ant, download UMLGraph from

2. Place UMLGraph.jar in your project, for example, under

3. Write or modify your ant script, for example:

   The specification for the Java-based umlgraph build processes.


4. Run this ant script.

ant javadocs

5. You will get the UML class diagram as expected in the generated Java docs. Here’s one example (click to enlarge):


Leave a Comment