30

I want to generate UML class diagrams from my actual Java code. I used Visual Paradigm when I had an academic License but as it is rather expensive I would like some recommendations.

Required

  • See links between classes
  • It allows me to modify the UML after generation (svg could work).
  • Free, even for commercial use
  • Linux

Nice plus

  • Does not depend on KDE (has small dependencies)
  • See which fields are linked from a class to another
  • See links between packages
  • Open Source
  • Light weight (Visual Paradigm is terribly heavy and that was annoying sometimes)

I don't mind if it is an eclipse plugin or a standalone application.

Follow up

I tried Umlet which I really liked for its lightness and speed but it does not show the links between classes and that makes it almost useless for me.

I tried papyrus as suggested but it does not do the expected work. At least if I have a lot of spare time some day I will know what project to work on.

3

I had a need to do this a while ago, and I had the best outcome via umlgraph .. by modifying the ant build files (in the javadoc section), you get UML diagrams generated for you whenever you do an ant-build of a target that includes javadoc.

Under the hood, umlgraph uses graphviz, so you will need graphviz installed but I am sure that will be in the standard repo of whatever distribution you are using.

I found this article really useful when I had to do this ..

Some alternatives

  • ydoc (from yworks) does a javadoc doclet .. functions similar to umlgraph in embedding SVG or flash based class (and other UML) diagrams within generated javadoc files .. Unlike umlgraph, it is a full stand-alone GUI tool

  • ObjectAid costs only $19 and was quite promising and very very useful.

I kept some notes of other tools (including some that are eclipse based plugins) .. and can dig them up, if you are interested in looking at some other alternatives.

  • 1
    Sounds like a great solution. I already used graphviz with doxygen and did not think of using it with javadoc. I'll give it a try as soon as I have some time for this. – Johnride Apr 30 '14 at 16:04
  • @Johnride, yeah the blending into ant or maven build files is very useful. However, given what you describe, ObjectAid seems like a perfect fit. Seems they revised their license and you only need a license for sequence diagrams .. well, you can also get an evaluation license. It is an eclipse plugin that reflects the changes (new code, refactoring) in your code within eclipse. I really think you should look more closely at it. – Chux Uzoeto May 1 '14 at 22:20
  • Here's objectaid's breakdown of what is free and what costs a little license fee .. together with the cost of their licenses. Really agreeable. – Chux Uzoeto May 1 '14 at 23:10
0

The Eclipse Papyrus project will allow you to do that. It works on Linux and is completely free.

I have used it a couple of times. It does the job but doesn't produce nice diagrams like the ones created in VS which look really cool.

There are a couple more options, some of them in this SO question: https://stackoverflow.com/questions/6167266/generate-uml-class-diagram-from-java-project

  • Guys, if you don't like the answer, tell why. Don't just secretly downvote it like some cowards. On a separate note, Papyrus didn't impress me. I've spend a day studying it and couldn't figure out how to turn the whole project to a UML. A UML of a single Java class is next to useless. – sixtytrees Jun 23 '16 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.