macOS High Sierra
(10.13.6
)运行MATLAB R2014a
,结果出现空指针异常,具体异常信息如下图:网上查询很久,找到问题原因,具体的官方解释如下:
Description
When running MATLAB on Mac OS X version 10.10 Yosemite, the following Java exception is reported:
1 2 3 4 5 6 7 8 9 10 11 12 |
java.lang.NullPointerException at com.mathworks.widgets.WindowsWidgetFactory$SearchAndClearButton.anyText(WindowsWidgetFactory.java:187) at com.mathworks.widgets.WindowsWidgetFactory$SearchAndClearButton.getIcon(WindowsWidgetFactory.java:195) at com.apple.laf.AquaButtonUI.setThemeBorder(AquaButtonUI.java:113) at com.apple.laf.AquaButtonUI.installDefaults(AquaButtonUI.java:80) at javax.swing.plaf.basic.BasicButtonUI.installUI(BasicButtonUI.java:88) at javax.swing.JComponent.setUI(JComponent.java:664) at javax.swing.AbstractButton.setUI(AbstractButton.java:1807) at javax.swing.JButton.updateUI(JButton.java:146) at javax.swing.AbstractButton.init(AbstractButton.java:2172) at javax.swing.JButton.(JButton.java:136) . . . |
Following this, MATLAB may exit abruptly.
Fix
This bug was fixed as of R2014b.
If you have a current subscription to MathWorks Software Maintenance Service (SMS), you can download product updates. If not, learn more about MathWorks SMS.
Workaround
Note: If you cannot launch MATLAB at all, please see Bug Report 1116607, "Cannot launch MATLAB 14a or earlier on OS X 10.10 Yosemite".
For MATLAB R2012a through R2014a only.
To install this patch, you need the name and password of an account with Administrator privileges.
Download the appropriate patch file for the version of MATLAB you wish to patch.
Look for the file in your Downloads folder, the Desktop, or wherever your Web browser saves downloaded files.
If your Web browser did not unzip the patch file for you, double-click the file in the Finder to unzip it.
Double-click the .dmg file to mount the disk image.
At the top level of the mounted disk image is an application such as R2014a_patch_1098655.app. Double-click to launch it.
Select your MATLAB installation. Select the root folder of the install, for example, MATLAB_R2014a.app.
Enter the name and password of an account with Administrator privileges.
New Java class files will be installed in the java/patch/com/mathworks/widgets folder of your MATLAB installation.
When the upgrade is complete, you can launch MATLAB.
这个属于程序的BUG
,官方提供的补丁程序。点击这里下载 R2014a_patch_1098655