Fixing an X11 problem with Matlab 2009a on a Mac
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/MATLAB_R2009a.app/sys/os/maci/libXm.3.dylib
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.
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!
-Ziv
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,
Mike
Thank you!! This fixed my problem. Can’t see why Mathworks can’t fix their installer…
Thanks a lot!!!
You are a genius, why didn’t I come up with this idea myself?
Thanks again…
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
Thanks!!!
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 2.3.3.2 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
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 – support@mathworks.com
Sorry I can’t be more help,
Mike
I am having the same problem but with java. Anyone know of a fix??
I had the same problem, matlab crushed with same error when updating mac 10.5 to 10.6 , worked perfectly for me.
many thanks