Fixing an X11 problem with Matlab 2009a on a Mac

April 2nd, 2009 | Categories: Mac OS X, matlab | Tags:

I recently installed MATLAB 2009a on a Mac running Mac OS 10.5.6 and, although the installation seemed to go fine, MATLAB wouldn’t start.  The error message I received (copied from the console output) was

02/04/2009 16:19:42 [0x0-0x2d32d3].com.mathworks.StartMATLAB[36443] dyld: Library not loaded: /usr/X11R6/lib/libXmu.6.dylib
02/04/2009 16:19:42 [0x0-0x2d32d3].com.mathworks.StartMATLAB[36443] Referenced from: /Applications/
02/04/2009 16:19:42 [0x0-0x2d32d3].com.mathworks.StartMATLAB[36443] Reason: image not found

Now I don’t know very much about Macs and I tend to think of Mac OS X as a closed-source version of Linux with pretty bits so there may be a much better way of fixing this than what you are about to read but it did the job for me. Your mileage may vary.

Firing up a terminal I had a look to see if the offending file was anywhere on the machine by typing

locate libXmu.6.dylib

Sure enough I had it in /usr/X11/lib but MATLAB was looking for it in /usr/X11R6/lib so I created a symbolic link as follows

sudo ln -s /usr/X11 /usr/X11R6

Tried MATLAB again and it worked perfectly. Let me know if this works for you or if you are a Mac expert and you know of a better way.

  1. Ziv
    April 10th, 2009 at 01:29
    Reply | Quote | #1

    So actually, they recommend you install X11 from the Mac OS X disk that comes with your computer. And, believe it or not, this install creates a symbolic link from X11R6 to X11 just as you did. It may be possible that it added some files to my X11 folder, but I highly doubt it.

    If you care to install X11 from CD (even though you have X11 installed already), Pop in CD1, go to Optional Installs, and Applications->X11

    Hope this helps!

  2. Mike Croucher
    April 10th, 2009 at 03:31
    Reply | Quote | #2

    Hi Ziv

    Thanks for the advice but the problem with this particular machine was that it wasn’t mine. I was called out to help a user’s machine at my university and X11 was already installed so I just fixed what was there. Reinstalling X11 completely from CD seems a bit much when all that was required was a symbolic link.

    Best Wishes,

  3. Will
    April 17th, 2009 at 20:55
    Reply | Quote | #3

    Thank you!! This fixed my problem. Can’t see why Mathworks can’t fix their installer…

  4. somebody
    May 17th, 2009 at 15:01
    Reply | Quote | #4

    Thanks a lot!!!

    You are a genius, why didn’t I come up with this idea myself?

    Thanks again…

  5. anotherbody
    July 28th, 2009 at 18:58
    Reply | Quote | #5

    I could fix a similar problem for Matlab 2008b by doing the same

    I can now launch Matlab from darwin terminal, but I cannot do from Finder, never mind, it is working


  6. eric
    August 31st, 2009 at 19:38
    Reply | Quote | #6

    I also have a problem with my matlab. I have been running it fine for about a year, now it just stopped working. the message I get says that x11 is not installed but it is and is version and the startmatlab says that i need version 1.1.3 or better. This just happened out of no where no setting were changed and no updates made. pls help

  7. Mike Croucher
    September 1st, 2009 at 09:26
    Reply | Quote | #7

    Hi Eric

    The first thing I need to be able to do before I can help you is to reproduce the problem myself and I can’t I’m afraid. I suggest that you send a message to Mathworks support –

    Sorry I can’t be more help,

  8. Fernando
    November 9th, 2009 at 04:00
    Reply | Quote | #8

    I am having the same problem but with java. Anyone know of a fix??

  9. amin
    June 2nd, 2011 at 08:52
    Reply | Quote | #9

    I had the same problem, matlab crushed with same error when updating mac 10.5 to 10.6 , worked perfectly for me.

    many thanks