Monday, April 27, 2015

Running MATLAB 2012b on MAC OS X Yosemite

I have been trying to install the MATLAB 2012b on MAC OS X 10.10.3 (Yosemite), however, starting the application after installation keeps gives an error message "Unexpected Exception: There was an unexcepted exception" that refers to the path of log file with error details.

I checked what was inside the log file, and I have found the following message about the reason of the exception:

 com.mathworks.instutil.JNIException: java.lang.UnsatisfiedLinkError: Cant load library: /Applications/  
 java.lang.UnsatisfiedLinkError: Cant load library: /Applications/  

Doing a quick search about problems starting MATLAB on MAC OS X, I have found out that the reason might be the version of java that I am running.

I checked the version of java installed on my machine using

 java -version  

and the output was 
 java version "1.8.0_40"  
 Java(TM) SE Runtime Environment (build 1.8.0_40-b27)  
 Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)  

as I am running Oracle Java 1.8. 

I followed the instructions from this stack overflow answer, to remove the existing installation of Java 1.8 from my Mac.
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin

then I installed the Java for OS X from Apple:

Now, I tried again launching the MATLAB. I noticed that the error message have changed as now the application runs and I can view the splash screen but by the time when it is supposed to display the MATLAB desktop environment, it shows another error message instead.

The new error message is 

Error Starting Desktop:

  at com.mathworks.widgets.WindowsWidgetFactory$SearchAndClearButton.anyText(   
  at com.mathworks.widgets.WindowsWidgetFactory$SearchAndClearButton.getIcon(   
  at javax.swing.plaf.basic.BasicButtonUI.installUI(   
  at javax.swing.JComponent.setUI(   
  at javax.swing.AbstractButton.setUI(   
  at javax.swing.JButton.updateUI(   
  at javax.swing.AbstractButton.init(   
  at javax.swing.JButton.<init>(   

At this moment, I was able to start the MATLAB from the command line, but without the desktop GUI environment using the commands:
 sudo /Applications/ --nodesktop  
 sudo /Applications/ --nojvm  

I tried installing X11 which is claimed to be required by MATLAB on OS X as stated here  but still the problem persists to happen.

Finally, I noticed that there is a bug report for this issue on MathWorks website that provides a patch for solving this issue. I downloaded the patch from , and  run at as described in the instruction on the page and now I can run MATLAB normally on my MAC Yosemite! :D :D

No comments:

Post a Comment