nus-cs2103-AY2122S2 / forum

14 stars 1 forks source link

πŸ’‘ Setting up PlantUML for Mac (Using Homebrew) #232

Open sbhbenjamin opened 2 years ago

sbhbenjamin commented 2 years ago

Hello, I thought I'd share this in case someone runs into the same problem while setting up PlantUML on a mac.
When you are setting up PlantUML following the SE-EDU Tutorial, you will first have to install GraphWiz:

  1. Install Graphviz. Graphviz is a dependency that PlantUML requires to generate more advanced diagrams. Head over to the downloads page on the official Graphviz website and follow instructions to install Graphviz.
  2. Install the PlantUML integration plugin in IntelliJ IDEA.
    1. Go to Settings > Plugins > Marketplace and install the plugin PlantUML integration.
    2. Then go to Settings > Languages & Frameworks > PlantUML or search for PlantUML. Configure the path to the dot executable. This executable can be found in the /bin directory where you installed GraphViz earlier.

For step 2.ii, I was unable to find the dot file. After some peering around, the dot file was stored at /opt/homebrew/Cellar/graphviz/3.0.0/bin/dot for homebrew users. You can key this path in into the Graphiz dot executable field in step 2.ii.

Hope this helps in some way!

aweijun commented 2 years ago

Thanks! This was super helpful! πŸ˜„

jbkim1999 commented 2 years ago

Thank you! I was struggling with this issue as well, this approach certainly works on my M1 mac too!

punnyhuimin commented 2 years ago

I'm using a Mac, but this unfortunately didn't work for me. 😒 I found a StackOverflow thread on how to find the dot executable file and now it's working. https://stackoverflow.com/questions/54966989/where-do-i-add-graphvizs-executable-on-a-mac

TLDR:

  1. Download GraphViz via homebrew

    brew install graphviz
  2. Now, you need to get the directory of the dot executable. I tried to find it in my finder but couldn't do so as the folder is not visible to me. What you need to do is to run

    which dot

    This returns the directory in which the dot executable file is at.

    Screenshot 2022-04-06 at 3 30 48 PM
  3. Lastly, just copy the directory and paste it into the GraphViz dot executable section.

    Screenshot 2022-04-06 at 3 32 12 PM
  4. Click "Ok" and restart Intellij to see your diagrams πŸ’―