Generate UML Class Diagram from Java Project

JavaUmlReverse EngineeringClass Diagram

Java Problem Overview


Is there a good tool that can help to reverse engineer Java classes to UML that will show an overview of how my classes are related to each other? It doesn't need to decompile from JAR file because I have the sources. I know there are quite a few out there but most of those can only generate individual class. I hope there is a tool that can generate class diagram that shows an overview of how all my current classes and packages work together, so that I can analyse my current architecture design. Of course, analysing is one thing. The other is for documentation purposes.

I know of a few so far. But they cannot do an overview class diagram. Here's a list of Java UML tool that I have tried and is capable of doing reverse engineer but cannot do an overview class diagram of my whole project:

  • StarUML (Really good Opensource UML tool but cannot generate not overview class diagram)
  • ArgoUML (It is slow and sluggish and it keeps crashing)
  • UModel (This is a commerical software. I used before some time ago but found it difficult to use)
  • MS Visio (It doesn't support Java UML reverse engineer. Only for VB)

Are there any other recommendations to add to this list? And hopefully, can generate an overview Java class diagram. I am using Eclipse, by the way.

Java Solutions


Solution 1 - Java

I wrote Class Visualizer, which does it. It's free tool which has all the mentioned functionality - I personally use it for the same purposes, as described in this post. For each browsed class it shows 2 instantly generated class diagrams: class relations and class UML view. Class relations diagram allows to traverse through the whole structure. It has full support for annotations and generics plus special support for JPA entities. Works very well with big projects (thousands of classes).

Solution 2 - Java

I use eUML2 plugin from Soyatec, under Eclipse and it works fine for the generation of UML giving the source code. This tool is useful up to Eclipse 4.4.x

Solution 3 - Java

How about the Omondo Plugin for Eclipse. I have used it and I find it to be quite useful. Although if you are generating diagrams for large sources, you might have to start Eclipse with more memory.

Solution 4 - Java

I´d say MoDisco is by far the most powerful one (though probably not the easiest one to work with).

MoDisco is a generic reverse engineering framework (so that you can customize your reverse engineering project, with MoDisco you can even reverse engineer the behaviour of the java methods, not only the structure and signatures) but also includes some predefined features like the generation of class diagrams out of Java code that you need.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCarvenView Question on Stackoverflow
Solution 1 - JavaJonatan KaźmierczakView Answer on Stackoverflow
Solution 2 - JavaHeisenbugView Answer on Stackoverflow
Solution 3 - JavaSwaranga SarmaView Answer on Stackoverflow
Solution 4 - JavaJordi CabotView Answer on Stackoverflow