MATLAB Answers


Java 1.6.0_51 breaks MATLAB 2012b and below

Asked by Mark
on 19 Jun 2013
Latest activity Answered by Wilfred
on 2 Oct 2013

The Java 1.6.0_51 update released today breaks MATLAB 2012b and below. You can open the program but it does not register any mouse or keyboard interaction until the window is resized.

Is there a patch coming?


the cyclist
on 19 Jun 2013

I have 10.8.4, and I ran 2012b just fine.

on 19 Jun 2013

It may be the Java for OS X 2013-004 update released today that is now bundled with 10.8.4

on 20 Jun 2013

As another user pointed out in that from the command line, 'matlab -nodesktop' DOES work in the mean time.

The '-nojvm' option will not allow any GUI items, but '-nodesktop' will let you create plots and use the GUI features.


14 Answers

Answer by Shashank Prasanna
on 22 Jun 2013
Edited by Shashank Prasanna
on 22 Jun 2013
 Accepted answer

This issue has been fixed.

The was an issue in the Java security updates that Apple released for Mac OS X (as mentioned above). These updates install Java 1.6.0_51 and the exact build number looks like this (ending with M4508):

Java™ SE Runtime Environment (build 1.6.0_51-b11-456-10M4508) You can check if you have installed the xM4508 versions by running any one of the following commands on the Terminal of your Mac OS X:

java -version 


/usr/libexec/java_home -v 1.6 -exec java -version 

If you have previously installed the xM4508 versions of the Java updates you can upgrade to the fixed xM4509 version by manually installing the following update:

Mac OS 10.7.x and 10.8.x:

Mac OS 10.6.x:

Confirm that you have the updated Java version by executing any of the above two commands. The exact build number looks like this (ending with M4509):

Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-10M4509)

If you had not originally installed or

updates already (ending with M4508), you should receive this fix (ending with M4509) automatically through Software Update / App Store.

If you need further assistance feel free to contact Technical Support.



It is worth checking the SHA1 checksum on the downloaded file against that on the web page- the broken version was still being delivered a few hours ago, possibly because of cached versions.

on 24 Jun 2013

Does this solution also fix the problem with matlabpool (R2011a, OSX 10.6.8). I tried an older workaround which worked after a previous Java update but does not work for this one. Many thanks!

This solution (xM4509) works for me (Mountain Lion, Matlab R2012a). Thank you :)

Answer by Julien Aubert
on 19 Jun 2013

I found this workaround, should work until Apple/Mathworks issues a patch:

Download the Apple Java SE 2013-003 update (no longer on the Apple website but I found this link:

Then download and install Pacifist

Use Pacifist to open the Apple Java package and install using the install option of Pacifist.

Your Java SE should be downgraded to where it was prior to applying the 2013-004 patch. This worked for me, matlab is functional again.



Thank you, thank you, thank you! This solved the problem for me with R2012b on 10.8.4

(I only wish I had your answer several hours ago)

on 21 Jun 2013

Also worked for me. Also running 2012a on 10.7.5. Thank you.

Works for me too! many thanks!

Answer by Ken Atwell
on 22 Jun 2013

As Art noticed first, a new update to Java was posted on Friday. Run Software Update, and if that does not correct the problem, you will need to download and install the update manually:

More information can be found at

Thanks once again for your patience; we especially appreciate everyone chipping in here with suggestions and workarounds.

Ken Atwell

Product Manager, MATLAB Platforms


Answer by John
on 21 Jun 2013

Another method for OS X 10.7/10.8:

Note that this may also remove any other versions of Java installed alongside 1.6

Download Java 2013-003 from

In Terminal, copy and paste these 3 commands to remove enough of the new Java version to allow re-installation of Java 1.6.0_45:

sudo rm -rf /System/Library/Java/JavaVirtualMachines
sudo rm -rf /System/Library/Frameworks/JavaVM.framework
sudo pkgutil --forget

Then open the downloaded disk image and install JavaForOSX.pkg

You will now need to turn off automatic system updates, and refrain from installing the 2013-004 update when it gets offered again via the App Store.


I was able to remove enough of the new version of Java using on OS X 10.8 and reinstall java with

sudo rm -rf /System/Library/Java/JavaVirtualMachines sudo rm -rf /System/Library/Frameworks/JavaVM.framework sudo pkgutil --forget

but with

...108 instead of ...107 . Just wanted to share. Thanks so much for your help!

on 21 Jun 2013

Sorry, I didn't have time to find a new 10.8 machine to test. It appears that a 10.8 machine upgraded from 10.7 (that already had Java 1.6 installed) does not use the 10.8 package identifier. So there are 3 packages available depending on which OS you have and/or how it was upgraded:

To find which is installed on your machine, use the following terminal command:

pkgutil --pkgs=.*Java.*

Substitute the appropriate package version into the 'forget' command.

If you need to find out when a package was installed, use the following:

pkgutil --pkg-info | grep "install" 

Convert from Unix seconds to local time using:

date -j -f "%s" [insert time in seconds]

For 10.6.8, you will need to find a copy of 'Java for Mac OS X 10.6 Update 15'. This is no longer available from Apple, and I cannot recommend any sites, although you can find it if you look hard! Always check downloads from non-Apple sites for security by checking the SHA1 value of the downloaded file. See for how to do that. SHA1 values for the two files required can be found by looking in the Wayback Machine:

Java for Mac OS X 10.6 Update 15:

Java for OS X 2013-003 (for OS X 10.7 & 8)

Thanks John!! Had the same problem and your solution worked!! =D

Answer by Ken Atwell
on 20 Jun 2013

Both MathWorks and Apple are aware of the problem, and we are actively investigating. We will post updates here as we learn more. As others have reported, MATLAB versions R2012b and earlier are impacted. The only identified work-around just now is to use Time Machine or similar means to revert to the previous Java release.

Thanks for your understanding and patience.

Ken Atwell

Product Manager, MATLAB Platforms



This update broke our application too and we have figured out the problem and the fix, which was tricky to narrow down but easy to implement. I posted the details on StackOverflow, which should be all your developers need to get a fix out. Unfortunately it does not provide a workaround for users other than the Time Machine method you posted, or reverting to an older Java version for those lucky enough to have one available in their Java Preferences panel. Here is the link to my answer:

@Ken I have a Mac Pro updated to Mountain Lion from Snow Leopard with JDK 7 installed. Just replacing the copy of the JDK6 in the /System/Library/Java/JavaVirtualMachines solved the problem for me.

If Apple or TMW could provide a copy of that it could prove a quick fix for some users - there may be copies on the web as suggested by other posters but one of reliable provenance would be better.

MATLABers might also check in /Library/Java/JavaVirtualMachines - they may have a copy there.

The new update has been released; see my new answer elsewhere on this page.

Answer by Shashank Prasanna
on 19 Jun 2013

Here is the support roadmap:

On Mountain Lion (OS X 10.8) MATLAB R2012b is supported but not releases prior to that.


on 19 Jun 2013

I haven't checked 2013b but 2013a works.

on 20 Jun 2013

This does not answer the question. According to the roadmap, there is 2-year support for 10.6 still in effect. Saying that R2012b is not supported on releases prior to 10.6 contradicts the roadmap.

Hi Stewart, this was before the diagnosis of the issue. Please look at Ken Atwell's post for the latest information.

Answer by Mark
on 20 Jun 2013

I found a temporary workaround for OS 10.6.8 at least, and involves no installations:

    Close all programs
    Go to Applications / Utilities / Java Preferences
    The Java Prefs app will open
    In the 'General' Tab, change the order of Java SE, so that the two with the older versions are on top.  The versions are in the RH column on my system.  For example, my toplisted version was 1.6.0_51..., which is the latest version updated yesterday.  There were also two entries for 1.6.0_24...  Drag these so they are on top (64-bit first)
   Close the app
   Start MATLAB.  Now I can type and everything is good.

  1 Comment

on 20 Jun 2013

This will only work if you have other Java's installed. On my system, it seems the update (not sure which or when) has wiped all previous versions. The older verion folders are all symlinked to the 1.6 tree, see

user@host /System/Library/Frameworks/JavaVM.framework/Versions $ ls -l
total 72
lrwxr-xr-x   1 root  wheel    5 Jun 19 14:06 1.3 -> 1.3.1
drwxr-xr-x   3 root  wheel  102 Jul 20  2009 1.3.1
lrwxr-xr-x   1 root  wheel   10 Jun 19 14:06 1.4 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jun 19 14:06 1.4.2 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jun 19 14:06 1.5 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jun 19 14:06 1.5.0 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jun 19 14:06 1.6 -> CurrentJDK
lrwxr-xr-x   1 root  wheel   10 Jun 19 14:06 1.6.0 -> CurrentJDK
drwxr-xr-x  10 root  wheel  340 Jun 19 14:09 A
lrwxr-xr-x   1 root  wheel    1 Jun 19 14:07 Current -> A
lrwxr-xr-x   1 root  wheel   59 Jun 19 14:06 CurrentJDK -> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents

I tried this option, but only the latest 1.6.0_51 is available. Manually installing a new java on OSX seems a bit hairy.

Answer by Tobias
on 20 Jun 2013

This has also happened to me, Matlab 2012a, OS X 10.7.5.


Answer by Fabs
on 20 Jun 2013

I ran into this problem today. If you have a time machine backup, you can simply replace /System/Library/Java with a time machine backup from before the update. No need to install anything.


on 20 Jun 2013


I have the same problem.

I did the TM restoration, but it doesn't seems to work for me. Is there any way to get rid of the 004 update and instal the 003?, I do have the JavaForOSX2013-003.dmg


—MATLAB R2012a—OS X 10.8.4—Xcode 4.6.3—Java 004—

on 21 Jun 2013

Hm, it definitely worked for me. It may be a stupid question, but did you make sure you really restored the old (pre-update) folder? I believe Apple issued the update 06/19, so the folder after restoration should have a date 06/18 or older.

Answer by Antonio
on 21 Jun 2013

it is inconceivable that the apple makes available an update without first being her some of its operation. is inconceivable block the work of the people.


Answer by Art
on 22 Jun 2013

Apple has released a new version of the 1.6.0_51 update, so it is no longer necessary to hack a downgrade. The fix is described here:

You have to manually download the JavaForOSX2013-0004 update. I've tried it and it restored my Matlab to working again. This was a rather nasty mix-up.


Answer by ML
on 27 Jul 2013

So, how about Java 7 support on OS X sometime this century?

Why do I have to install EOL Java 6 just to install your stuff? Most developers simply fail to build for 64-bit, but you guys are 64-bit, and still not Java 7 compliant. What gives?

It's time to get JAVA itself on your Product Roadmap as well: ...which seems long overdue.


Answer by Timothy
on 30 Aug 2013

Shame the Java update was not rolled out as a 'Software Update', or if it was my Pro didn't do it. I've had heartache for a couple of months almost making me buy a new Pro and Matlab V13 :-) - Damm it now works...


Answer by Wilfred
on 2 Oct 2013

THANK YOU !!!!!!!


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!