Use IntelliJ to generate class diagram

242,281

Solution 1

Use Diagrams | Show Diagram... from the context menu of a package. Invoking it on the project root will show module dependencies diagram.

If you need multiple packages, you can drag & drop them to the already opened diagram for the first package and press e to expand it.

Note: This feature is available in the Ultimate Edition, not the free Community Edition.

Solution 2

IntelliJ IDEA 14+

  • Show diagram popup

    Right click on a type/class/package > Diagrams > Show Diagram Popup...
    or Ctrl+Alt+U

  • Show diagram (opens a new tab)

    Right click on a type/class/package > Diagrams > Show Diagram...
    or Ctrl+Alt+Shift+U

    right click Diagrams Show Diagram

By default, you see only the classes/interfaces names. If you want to see more details, go to File > Settings... > Tools > Diagrams and check what you want (E.g.: Fields, Methods, etc.)


P.S.: You need IntelliJ IDEA Ultimate, because this feature is not supported in Community Edition. If you go to File > Settings... > Plugins, you can see that there is not UML Support plugin in Community Edition.

Solution 3

You can install one of the free pugins - Code Iris. enter image description here


PlantUML

enter image description here

Other tools of this type in the IntelliJ IDEA are paid.


I chose a more powerful alternative:
In Netbeans - easyUML
In Eclipse - ObjectAid, Papyrus, Eclipse Modeling Tools

enter image description here


I hope it will help you.

Solution 4

Try Ctrl+Alt+U

Also check if the UML plugin is activated (settings -> plugin, settings can be opened by Ctrl+Alt+S

Solution 5

Use Intellij plugin Sketch It!.

Class Diagram generated with Sketch It! plugin

Share:
242,281
Zack
Author by

Zack

Updated on January 15, 2021

Comments

  • Zack
    Zack over 3 years

    How do I get IntelliJ 10.5 (on the Mac) to generate a class diagram showing all of the classes in my project? I'm sure I'm overlooking something obvious, but I can only get the "Show Diagram" feature to show one class at a time. (I also figured out how to add additional classes, but again, only one at a time.)

  • Ectoras
    Ectoras over 8 years
    Hi guys, I am using Intellij 15.0.2 and I want to view class diagram of my project, however I can not see the selection Diagrams/Show Diagram when I right click in a package or a class. Can anyone help me?
  • ROMANIA_engineer
    ROMANIA_engineer over 8 years
    @Ectoras , I suppose that you use Community Edition, not Ultimate. It is not available for Community Edition (see the P.S.: added in the post). I tested it in IntelliJ IDEA 15.0.2 Ultimate and it worked.
  • Bruce Sun
    Bruce Sun over 7 years
    Does this mean there's no plugins available for community version to generate class diagram, now and in the future?
  • CrazyCoder
    CrazyCoder over 7 years
    @BruceSun not at the moment
  • mjs
    mjs over 7 years
    @CrazyCoder How do you use this to view a UML diagram for a class and it's edges, .. i am thinking find my nodes, dept 3 ... or all ... right now its pretty useless. it only shows class hiearchies, not what object it uses, and what those object in turn uses. This uml plugin is not useful.
  • Pipo
    Pipo almost 6 years
    Link down :-( could you fix it please?
  • WesternGun
    WesternGun over 4 years
    Code Iris just stops my project to launch. Community version 2019.1.
  • WesternGun
    WesternGun over 4 years
    ...which needs PlantUML plugin to visualize the diagram. With Community version 2019.1 it works, after installing Graphviz and adding bin to PATH. Windows 10. But, it only renders relationship in each package, not in the whole projects, thing that I expected, but thanks anyway.
  • Kas Elvirov
    Kas Elvirov over 4 years
    @WesternGun i'm not surprised man. This tool with 3 stars rating...
  • subject-q
    subject-q almost 4 years
    I installed PlantUML plugin, but do not know how to get started and use it. Please add that also
  • Dwarakesh Pallagolla
    Dwarakesh Pallagolla over 3 years
    looks like PlantUML is used to create class diagrams? I did not see any use case/instructions online where it can be used to generate class diagrams automatically.
  • alen
    alen about 2 years
    sketch It is an amazing tool :》thanks