Tuesday, 27 January 2015

Running Dia on Mac OS X Yosemite

Dia is an excellence tool to draw UML diagrams. Originally it was built for Linux. Later, it is also exported to Windows and Mac OS X.

It could be downloaded from here:
http://dia-installer.de/download/index.html

For some strange reason, it cannot be run normally on Mac OS X Yosemite. To run it, you should run the follow command in the terminal:


DISPLAY=:0 /Applications/Dia.app/Contents/Resources/bin/dia

The another way to run it is set the command DISPLAY=:0 in the running file. Here are the steps:
1. Go to the Application directory
2. Right click on Dia and select "Show package contents"
3. Go to Contents -> Resources -> bin
4. Open dia file with an text editor
5. Remove the block under # Check for X11 and just leave the line which says:

export Display=:0

It will be something like this:

#export PATH="/usr/texbin:/opt/local/bin:/sw/bin/:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/local/bin:$CWD:$PATH"

# Check for X11
export DISPLAY=:0

startx=`which startx`
if [[ "" == $startx ]]; then
 if [[ ! -e /opt/X11/bin/startx ]]; then
   osascript -e 'tell app "System Events" to display dialog "X11 (XQuartz) is not installed or not running. Would you like to visit xquartz.macosforge.org now in order to download and install XQuartz?" with icon 0'
   if [[ $? -eq 0 ]]; then
     open http://xquartz.macosforge.org
     exit
   fi
  fi
fi

Source:
Technical Blog - Dia Diagram Mac OSX Yosemite Fix

3 comments:

  1. Thank you so much.. Your suggestion save my day

    ReplyDelete
  2. Awesome. Works like a charm

    ReplyDelete