Install PlantUML and Java on Mac

Install PlantUML and Java on Mac

βœ… PART 1: Install Java

πŸ”Ή Step 1: Check Java

java -version

πŸ”Ή Step 2: Install Java

Option A (Homebrew):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install openjdk
sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
echo 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zprofile
source ~/.zprofile

Option B (Oracle Installer):

Download from Oracle Java Downloads

πŸ”Ή Step 3: Verify

java -version

βœ… PART 2: Install PlantUML

πŸ”Ή Step 1: Install Graphviz

brew install graphviz

πŸ”Ή Step 2: Install PlantUML

Option A: Download plantuml.jar from plantuml.com/download

Option B: Homebrew install:

brew install plantuml

βœ… PART 3: Run PlantUML

πŸ”Ή Option A: Using JAR

java -jar ~/tools/plantuml/plantuml.jar test.puml

πŸ”Ή Option B: Using Homebrew version

plantuml test.puml

πŸ”Ή Option C: IDE Integration

Use PlantUML plugin for VS Code or IntelliJ, set path to plantuml.jar if needed.

βœ… PART 4: Optional Alias

echo 'alias puml="java -jar ~/tools/plantuml/plantuml.jar"' >> ~/.zprofile
source ~/.zprofile

🧠 Troubleshooting

ProblemFix
java: command not foundInstall Java, check PATH
Error: Could not find or load main classCheck JAR file path
Diagrams not renderingEnsure Graphviz is installed (dot -V)

🎯 Summary

TaskCommand / Action
Install HomebrewSee Part 1 Step 2
Install Javabrew install openjdk
Install Graphvizbrew install graphviz
Install PlantUMLbrew install plantuml
Download JARplantuml.com/download
Run UML (JAR)java -jar path/to/plantuml.jar file.puml
Run UML (brew)plantuml file.puml
@startuml skinparam style strictuml title Snowflake Cloud Data Platform rectangle "Cloud Services Layer\n(Query Parsing, Optimizer, Metadata,\nSecurity, Access Control)" as CloudServices rectangle "Compute Layer\n(Virtual Warehouses,\nParallel Query Execution)" as Compute rectangle "Storage Layer\n(Columnar Data, Micro-partitions,\nStructured & Semi-Structured)" as Storage CloudServices --> Compute : Coordinates Compute --> Storage : Reads/Writes CloudServices --> Storage : Metadata Access @enduml