MATLAB problems after Java for Mac OS X 10.6 Update 16 or Java for OS X 2013-004 are installed
After the latest round of Apple’s Java updates, some Java-based applications began exhibiting problems. At my shop, MATLAB was one of the applications that was affected by this.
The root cause was discussed and identified in this StackOverflow thread and appears to affect Swing applications, including MATLAB.
Symptoms
After applying Apple’s Java For Mac OSX 10.6. Update 16 to a 10.6.x Mac, or Java for OS X 2013-004 to a 10.7.x – 10.8.x Mac, MATLAB 2012b and below stops functioning correctly. You can open the program but it does not register any mouse or keyboard interaction until the window is resized.
Status as of Friday, June 21
After speaking with Mathworks support, I tested and verified the following:
MATLAB R2011a runs in Mac OS X 10.6.8, 10.7.5 and 10.8.4 with the latest Apple Java updates installed.
MATLAB R2013a runs in Mac OS X 10.7.5 and 10.8.4 with the latest Apple Java updates installed. MATLAB R2013a does not support 10.6.8.
At the moment, here are the options that appear to be available:
For 10.6.x: MATLAB users should install and use MATLAB R2011a
For 10.7.x – 10.8.x: MATLAB users should upgrade to MATLAB R2013a if possible. If not possible to upgrade to 2013a for code compatibility reasons, MATLAB users should install and use MATLAB R2011a.
Other options may include trying to roll back Java to the previous version, but that can cause other issues. I don’t recommend trying that unless neither MATLAB R2013a or MATLAB R2011a are viable options.
Update – Friday, June 21 at 5:15 PM EDT
It looks like Apple has resolved this issue by posting new versions of the Java For Mac OSX 10.6. Update 16 and Java for OS X 2013-004 installers:
Java for OS X 2013-004 – http://support.apple.com/kb/DL1572
Java for Mac OS X 10.6 Update 16 – http://support.apple.com/kb/DL1573
I’ve tested the newly rev’d Java for Mac OS X 10.6 Update 16 update on 10.6.8 and MATLAB R2012b. The new update allowed MATLAB R2012b to run normally again. I still need to test 10.7.5 and 10.8.4, but this looks promising.
Update – Friday, June 21 at 9:40 PM EDT
I’ve now tested the new revision of the Java for OS X 2013-004 update on Mac OS X 10.7.5 and 10.8.4, both times with MATLAB R2012b. The new update allowed MATLAB R2012b to run normally again on both OSs.
This issue has been resolved by Apple:
(10.7, 10.8+)
(10.6-only)
…apparently the links got stripped out. Download the latest manual Java update package from Apple.
Thanks, Mike. I’m testing that now with MATLAB R2012b.
Links for those who need them:
Java for OS X 2013-004 – http://support.apple.com/kb/DL1572
Java for Mac OS X 10.6 Update 16 – http://support.apple.com/kb/DL1573
This might be of interest if you want a simple way to force an update, which is only possible for the JavaForOSX updates (i.e. 10.7 and 10.8):
One condition in the update’s .dist file is the environment variable JAVA_INSTALL_ON_DEMAND, which is ostensibly used for the “install Java on demand” feature available in the OS X GUI since Lion.
So, you could force an update by setting this environment variable alongside a softwareupdate invocation (as root), wherein JavaForOSX is given as the only update to install:
JAVA_INSTALL_ON_DEMAND=1 softwareupdate -i JavaForOSX-1.0
I installed the Java for Mac OS X 10.6 Update 16 and Matlab still can’t work normally. 😦
We’ve noticed some customers have had problems with upstream ISP caching. If you wait a few hours and re-download the manual, you should get the right bits. You can confirm which version you have by invoking:
/usr/libexec/java_home -v 1.6 -exec java -version
Make sure that the end of the version string ends in *M4509, not *M4508.
Don’t we just love Java!
It once took me days to resolve a problem with R and Java.
The update works for 10.6.8 – on both 2012a and 2010a. Thanks for the tip!
Dang…I just wasted 12 minutes and 30 seconds updating both of our packages. 😉
Don
Wonderful, thank you. I could still use matlab -nodesktop in a terminal, but I was considering trying to downgrade the Java update, as I suspected it was the cause. It’s baffling that they didn’t make it a new version so Software Update would pick it up.
Thank you for posting! I almost crashed my matlab
We are running into an issue with not distributing Java 6, but Oracle Java like Java 8 Update 25. When we launch MATLAB R2103a it displays a prompt:
To open “MATLAB”, you need a Java SE 6 runtime. Would you like to install one now.
We are going to try installing the latest MATLAB available for OS X after we upgrade our license server and see if the update helps resolve the issue, but I was curious if anybody had tips on getting MATLAB to work with Oracle vs Apple Java’s.