Master PlantUML in IntelliJ: Install, Configure Graphviz, and Create Diagrams
Learn how to set up PlantUML in IntelliJ IDEA by installing the PlantUML plugin, configuring Graphviz, adding environment variables, and using simple code snippets to generate UML and flowcharts, with step‑by‑step screenshots and tips for alternative browser‑based usage.
What is PlantUML
PlantUML is an open‑source project that enables fast creation of UML diagrams using a simple textual language, and it renders the diagrams with the powerful Graphviz graphics library. The generated diagrams can be exported as PNG images or scalable SVG files.
Advantages of PlantUML
Fully text‑based editing without drag‑and‑drop controls, automatically adjusts element spacing, and produces clean, attractive diagrams.
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, and Notepad++.
Since Java developers often use IntelliJ IDEA as their primary IDE, this guide focuses on using PlantUML within IDEA.
Installing the PlantUML Plugin in IntelliJ IDEA
Navigate to File → Settings → Plugins, search for "PlantUML", locate the "PlantUML integration" plugin, and install it.
Installing Graphviz on Your Computer
Download the Graphviz installer from the official site (e.g., graphviz-2.38.msi ).
Configuring Environment Variables
Add a system variable named GRAPHVIZ_HOME with the installation path (e.g., D:\WorkWare\Graphviz2.38). Then edit the Path variable to include: %GRAPHVIZ_HOME%\bin Also add a variable GRAPHVIZ_DOT with the value:
%GRAPHVIZ_HOME%\bin\dot.exeConfiguring Graphviz in IntelliJ IDEA
Open File → Settings → Other Settings → PlantUML and set the path to the Graphviz dot executable.
Creating Diagrams with PlantUML
Create a new .uml file in IDEA and write PlantUML code. 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 of the editor.
You can also generate UML class diagrams directly from your Java code using IDEA's built‑in features.
Other Options
If you prefer not to install Graphviz locally, 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.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
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.
