Boost Your Java Docs: Quickly Create UML Diagrams with PlantUML in IntelliJ IDEA
This guide shows Java developers how to install Graphviz and the PlantUML plugin in IntelliJ IDEA, configure environment variables, and use PlantUML syntax to generate flowcharts and class diagrams directly within the IDE, plus alternatives like Chrome extensions for quick diagram rendering.
Many developers ask how to draw flowcharts or UML class diagrams; this article recommends the PlantUML plugin for IntelliJ IDEA to quickly create them.
What is PlantUML
PlantUML is an open‑source project that provides a complete textual language for describing UML relationship diagrams and generates the diagrams using the powerful Graphviz rendering engine. The resulting UML images can be exported as PNG or scalable SVG files.
Advantages of PlantUML
Fully text‑based editing, no drag‑and‑drop controls, automatic spacing, simple and attractive output.
Independent of any development platform; as long as the PlantUML JAR is available, diagrams can be generated.
Integrates with many text editors and IDEs such as IntelliJ IDEA, Eclipse, Notepad++ and others.
For Java developers who typically use IntelliJ IDEA, the following steps focus on using PlantUML within IDEA.
Install the PlantUML Plugin in IDEA
File → Settings → Plugins, search for "PlantUML", locate "PlantUML integration" and install it.
Install Graphviz on Your Computer
Download Graphviz from the official site (e.g., https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi).
Configure environment variables:
Add a variable GRAPHVIZ_HOME with the installation path, e.g., D:\WorkWare\Graphviz2.38. Then append %GRAPHVIZ_HOME%\bin to the Path variable and set GRAPHVIZ_DOT to %GRAPHVIZ_HOME%\bin\dot.exe.
Verify the configuration by opening a Windows command prompt and running dot -version; the version information should be displayed.
Configure Graphviz in IDEA
File → Settings → Other Settings → PlantUML.
Draw a Flowchart with PlantUML
Create a new .uml file in IDEA.
Enter PlantUML text, for example:
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@endumlThe diagram is rendered in real time on the right side.
If you prefer not to install Graphviz, you can use the Chrome extension "PlantUML Viewer" to edit PlantUML text and view diagrams directly in the browser.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
