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