23

Is there a program around that can generate (UML) class diagrams from Java source code?

There is a reason I am not using Eclipse, regardless of whether the reason makes sense, therefore I do not want to rely on an Eclipse plugin for generating the diagram.

I'd actually want it for usage on Java 8, however if there even is such a program that works on Java 7, I'd be happily interested to follow the project.

A Netbeans plugin working on Netbeans 8.0 Beta would be okay as well, but I doubt they exist.
Also the program should be freeware.

1
  • PlantUML has a NetBeans plugin, but it uses its own syntax instead of automatic diagram generation (unless you use the javadoc integration with which you'd still have to code the diagrams yourself in the comments) so it doesn't qualify as an answer, but it thought it was worth mentioning.
    – Tymric
    Commented Aug 9, 2016 at 18:30

2 Answers 2

10

Visual Paradigm is a very good tool for diagrams. I've used it during my university a few years back to draw diagrams and generate code from the diagramsUML, and I've always saw an option to do the reverse but haven't used it personally.

They have a feature that called (Round-trip code engineering Forward and reverse engineering) enter image description here

The program has a free community version, but to be honest, I can not really remember if I was using the free version or the paid one provided by the university. But they had a 30 days trial.

4
  • To be able to use the feature you need to use the real version, so that means a 30 day trial... This answer definately deserves my upvote, but it's not a final answer.
    – skiwi
    Commented Mar 2, 2014 at 15:05
  • It seems this guy has found some answers -> (stackoverflow.com/questions/6167266/…) for stand alone programs [class-visualizer] and netbeans plugin. Commented Mar 2, 2014 at 15:54
  • Ah, thanks for finding them. However [class-visualizer] is not smart enough to understand complicated structures and the netbeans plugin seems to be only maintained until 5.5 if I'm not mistaken...
    – skiwi
    Commented Mar 2, 2014 at 16:47
  • Yes, it seems so. I just checked some samples for class-vis and it only shows the class name without depth of details. Good luck though. Commented Mar 2, 2014 at 16:52
3

I was personally a big fan of StarUML version 1.

But since the project became commercial, I switched to another forked project: WhiteStarUML.

In the open source (free) version of StarUML there was no support of Annotations and Generics.

The WhiteStarUML project have the class diagram generation from a Java project with a Reverse Engineering tool. Just follow the menu Tools -> Java 1.5 -> Reverse Engineer...

And the following popup appears to choose your Java code location; It can also ask you to put a Java Profile to your current project and just click Yes.

enter image description here

For me WhiteStarUML is the most stable one, I tried few others but not satisfied with.

The only cons for me is that it runs only on Windows platforms, but this is a requirement for you.

Since StarUML has been commercial, the old code has been forked many times. See here under some open source projects:

The StarUMLNS looks a good candidate but I admit I did not test it.

9
  • Sadly, there is no Java entry under Tools, at least not in the free version. And WhiteStarUML won't install: "The signature of WhiteStarUMLSetup-5.7.4.exe is corrupt or invalid"
    – CPerkins
    Commented Jun 30, 2016 at 0:48
  • Long time I did not test these. but since StarUML became commercial, there's a lot of forked open-source project (I'll update my answer)
    – рüффп
    Commented Jun 30, 2016 at 8:47
  • For the signature invalid, it look your download was not successful, I recommend to retry a download and if it continues, to try an older version (if available)
    – рüффп
    Commented Jun 30, 2016 at 8:48
  • 1
    I tried the download twice, but I'll try an older version from home tonight. Also, to be clear, it's not that star uml isn't supporting java 5.0 - it's that the menu path you give Tools -> Java -> Reverse Engineering doesn't exist. There's no Java under Tools, and I can't find any way to get there.
    – CPerkins
    Commented Jun 30, 2016 at 12:23
  • The menu was existing when I tried the software (at around post date). I did not check with more recent version which probably remove or moved some options somewhere else.
    – рüффп
    Commented Jun 30, 2016 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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