如何解决MATLAB启动sun.io.MalformedInputException异常

如何解决MATLAB启动sun.io.MalformedInputException异常

把MATLAB7.0装好后启动,竟然冒出这么一大堆的异常错误??



sun.io.MalformedInputException
at sun.io.ByteToCharGB18030.convert(Unknown Source)
at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(Unknown Source)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager.java:3186)
at org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipString(XMLEntityManager.java:2948)
at org.apache.xerces.impl.XMLDocumentScannerImpl$XMLDeclDispatcher.dispatch(XMLDocumentScannerImpl.java:563)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:221)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.getDomDocument(ProductInfoUtils.java:481)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.parseFile(ProductInfoUtils.java:403)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.parseAllFiles(ProductInfoUtils.java:460)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.pathChanged(ProductInfoUtils.java:342)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.<init>(ProductInfoUtils.java:288)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.getAllProductsInfo(ProductInfoUtils.java:966)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.<clinit>(ProductInfoUtils.java:274)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.mathworks.mde.desk.StartupClassLoader$LoadInfo.<init>(StartupClassLoader.java:76)
at com.mathworks.mde.desk.StartupClassLoader.addLoadInfo(StartupClassLoader.java:210)
at com.mathworks.mde.desk.StartupClassLoader.createLoadInfos(StartupClassLoader.java:186)
at com.mathworks.mde.desk.StartupClassLoader.access$400(StartupClassLoader.java:24)
at com.mathworks.mde.desk.StartupClassLoader$2.run(StartupClassLoader.java:138)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
解决方法:

方法1:

假设你安装到D盘,那么找到d:\matlab7\toolbox\ccslink\ccslink\info.xml 这个文件,用写字板打开这个文件 ,找到有一行这样的<name>Link for Code Composer Studio?/name>,把这句的/name>改成</name>,再保存一下这文件。 这样修改后,应当不会有问题了,我的就是这样解决的。

方法2:

在命令窗口执行以下语句试试:com.mathworks.services.Prefs.setStringPref('HelpSelectedProducts','MATLAB');

官方参考:


Technical Solutions

Why do I receive Java lang errors after starting MATLAB R14?

Date Last Modified: 25 Feb 2008

Solution ID:1-OVWJ9

Product:MATLAB

Reported in Release:R14

Platform:All Platforms

Operating System:All OS

Subject:Why do I receive Java lang errors after starting MATLAB R14?

Problem Description:
The following error messages appear in the MATLAB Command Window after MATLAB is started:

java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.mathworks.mlservices.MLHelpServices.getDocRoot(MLHelpServices.java:372)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.getAbsolutePath(ProductInfoUtils.java:847)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.parseFile(ProductInfoUtils.java:420)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.parseAllFiles(ProductInfoUtils.java:460)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.pathChanged(ProductInfoUtils.java:342)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.<init>(ProductInfoUtils.java:288) ...

This behavior was seen on Windows 2000 and XP.

Another similar error message on Linux is as follows:

sun.io.MalformedInputException
at sun.io.ByteToCharGB18030.convert(Unknown Source)
at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(Unknown Source)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager.java:3186)
at org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipString(XMLEntityManager.java:2948)
at org.apache.xerces.impl.XMLDocumentScannerImpl$XMLDeclDispatcher.dispatch(XMLDocumentScannerImpl.java:563) ...

Solution:

This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:

This error is ocurring because of a corrupt preference setting in the MATLAB preferences file. To fix this problem, start MATLAB and run the following statement in the Command Window, after the exceptions display:

com.mathworks.services.Prefs.setStringPref('HelpSelectedProducts','MATLAB');

After running the statement, quit MATLAB and then restart it. The problem should be fixed.


参考信息:



http://www.mathworks.com/support/solutions/data/1-OVWJ9.html?solution=1-
http://www.chinavib.com/forum/viewthread.php?tid=40470&extra=page%3D1
http://tieba.baidu.com/f?ct=335675392&tn=baiduPostBrowser&sc=3642103521&z=355500850&pn=0&rn=50&lm=0&word=matlab

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值