Matlab R2013a for Mac安装小记

firstboy05132016-03-09 14:50:21程序技巧 / 辅助工具

下载了Matlab R2013a for Mac安装的时候,因为我用的是OSX Yosemite 10.10版本,这里遇到两个小问题简述一下。

1. 一个是需要指定本地javadir。

在mount安装的iso文件后(我双击默认放的路径是/Volumes/MATLAB_801 R2013/),发现去点击里面的InstallForMacOSX.app启动起来一会儿就又消失了,也没有报错信息,然后自己打开shell窗口去运行InstallForMacOSX,然后就遇到如下com.google.inject.ProvisionException异常:

$ cd /Volumes/MATLAB_801 R2013/InstallForMacOSX.app/Contents/MacOS
$ sudo ./InstallForMacOSX

Preparing installation files ...
Installing ...
Exception in thread "main" com.google.inject.ProvisionException: Guice provision errors:

1) Error in custom provider, java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
  at com.mathworks.wizard.WizardModule.provideDisplayProperties(WizardModule.java:68)
  while locating com.mathworks.instutil.DisplayProperties
  at com.mathworks.wizard.ui.components.ComponentsModule.providePaintStrategy(ComponentsModule.java:76)
  while locating com.mathworks.wizard.ui.components.PaintStrategy
    for parameter 4 at com.mathworks.wizard.ui.components.SwingComponentFactoryImpl.<init>(SwingComponentFactoryImpl.java:111)
  while locating com.mathworks.wizard.ui.components.SwingComponentFactoryImpl
  while locating com.mathworks.wizard.ui.components.SwingComponentFactory
    for parameter 1 at com.mathworks.wizard.ui.WizardUIImpl.<init>(WizardUIImpl.java:62)
  while locating com.mathworks.wizard.ui.WizardUIImpl
  while locating com.mathworks.wizard.ui.WizardUI annotated with @com.google.inject.name.Named(value=BaseWizardUI)
  at com.mathworks.wizard.ui.UIModule.provideWizardUI(UIModule.java:50)
  while locating com.mathworks.wizard.ui.WizardUI
    for parameter 0 at com.mathworks.wizard.ExceptionHandlerImpl.<init>(ExceptionHandlerImpl.java:22)
  while locating com.mathworks.wizard.ExceptionHandlerImpl
  while locating com.mathworks.wizard.ExceptionHandler

1 error
	at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:767)
	at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793)
	at com.mathworks.wizard.WizardLauncher.startWizard(WizardLauncher.java:156)
	at com.mathworks.wizard.WizardLauncher.start(WizardLauncher.java:71)
	at com.mathworks.wizard.AbstractLauncher.launch(AbstractLauncher.java:27)
	at com.mathworks.wizard.AbstractLauncher.launchStandalone(AbstractLauncher.java:18)
	at com.mathworks.professionalinstaller.Launcher.main(Launcher.java:21)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:106)
	at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
	at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
	at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
	at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
	at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89)
	at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89)
	at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:95)
	at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
	at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
	at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
	at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
	at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
	at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
	at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
	at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
	at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
	at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
	at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
	at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
	at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
	at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
	at com.google.inject.Scopes$1$1.get(Scopes.java:54)
	at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
	at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
	at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
	at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
	at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89)
	at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89)
	at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:95)
	at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
	at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
	at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
	at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
	at com.google.inject.Scopes$1$1.get(Scopes.java:54)
	at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
	at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
	at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
	at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84)
	at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
	at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
	at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
	at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
	at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
	at com.google.inject.Scopes$1$1.get(Scopes.java:54)
	at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
	at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
	at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
	at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
	... 6 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:101)
	... 54 more
Caused by: com.mathworks.instutil.JNIException: java.lang.UnsatisfiedLinkError: Can't load library: /tmp/mathworks_35375/bin/maci64/libinstutil.dylib
	at com.mathworks.instutil.NativeUtility.loadNativeLibrary(NativeUtility.java:39)
	at com.mathworks.instutil.NativeUtility.<init>(NativeUtility.java:24)
	at com.mathworks.instutil.DisplayPropertiesImpl.<init>(DisplayPropertiesImpl.java:10)
	at com.mathworks.wizard.WizardModule.provideDisplayProperties(WizardModule.java:75)
	... 59 more
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /tmp/mathworks_35375/bin/maci64/libinstutil.dylib
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at com.mathworks.instutil.NativeUtility.loadNativeLibrary(NativeUtility.java:37)
	... 62 more
Finished

 

后来google了一下原来在Yosemite上面需要指定java_home路径,于是选择这里的x86_64(因为是64bit机器)的Java SE 6 HOME路径

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
    1.8.0_60, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
    1.6.0_65-b14-468, x86_64:	"Java SE 6"	/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    1.6.0_65-b14-468, i386:	"Java SE 6"	/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

然后再install的时候加上-javadir指明这个路径,之后安装还算顺利(里面还报了两行Error,不过后面Finished返回结果是0)。

$ sudo ./InstallForMacOSX -javadir /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Preparing installation files ...
Installing ...
Mar  9 14:28:34 zhuangguohuadeMacBook-Pro.local java[35494] <Error>: The function ‘CGContextErase’ is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.
Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
Warning:  org.apache.xerces.parsers.SAXParser: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.
Warning:  org.apache.xerces.parsers.SAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
Warning:  org.apache.xerces.parsers.SAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
2016-03-09 14:34:08.180 java[35494:132328] Metadata.framework [Error]: couldn't get the client port
Finished

2. 二是要打个官方的patch

安装完以后双击运行,然后弹出一个java NullPointer的错误,详细如下:

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.<init>(JButton.java:136) 
. . .

后来打到官方原来已经有个patch解决这个问题。详细内容摘抄如下。

http://www.mathworks.com/support/bugreports/1098655

Java® Exception and abrupt exit on Mac OS X version 10.10 Yosemite

 

Description

 

When running MATLAB on Mac OS X version 10.10 Yosemite, the following Java exception is reported:

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.<init>(JButton.java:136) 
. . .

Following this, MATLAB may exit abruptly.

 

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 R2011a through R2014a only.

To install this patch, you need the name and password of an account with Administrator privileges.

  1. Download the appropriate patch file for the version of MATLAB you wish to patch.
  2. Look for the file in your Downloads folder, the Desktop, or wherever your Web browser saves downloaded files.
  3. If your Web browser did not unzip the patch file for you, double-click the file in the Finder to unzip it.
  4. Double-click the .dmg file to mount the disk image.
  5. At the top level of the mounted disk image is an application such asR2014a_patch_1098655.app. Double-click to launch it.
  6. Select your MATLAB installation. Select the root folder of the install, for example,MATLAB_R2014a.app.
  7. Enter the name and password of an account with Administrator privileges.
  8. New Java class files will be installed in the java/patch/com/mathworks/widgetsfolder of your MATLAB installation.
  9. When the upgrade is complete, you can launch MATLAB.

 

Fix

This bug was fixed as of R2014b(8.4).

If you have a current subscription to MathWorks Software Maintenance Service (SMS), you candownload product updates. If not, learn more about MathWorks SMS.

Attachments

 

文章评论
比咕搜索引擎定制与数据分析技术服务
最新评论
比咕网移动端APP下载

iPhone、Android 手机
扫描二维码下载安装

(可以使用QQ,微博等的扫描二维码功能)