Why do I keep getting errors from Java in Matlab?
6 ビュー (過去 30 日間)
古いコメントを表示
My Matlab R2018b is giving Java errors. I have searched a lot on the internet for a solution but am unable to find one that works.
When do the errors occur?
I found a few ways to reproduce the errors.
When I have a line of code that looks like:
a = 1
This will of course create an orange wavy line under the = sign, since I forgot the ; at the end of the line. When I hover over orange wavy line it should give a suggestion, but instead it gives an error:
Exception in thread "AWT-EventQueue-0": java.lang.NullPointerException
at com.mathworks.help.helpui.DocRoot.buildUrl(DocRoot.java:216)
at com.mathworks.help.helpui.DocRoot.buildDocPageUrl(DocRoot.java:44)
at com.mathworks.mlwidgets.help.CSHelpTopicMap.mapIdToUrl(CSHelpTopicMap.java:244)
at com.mathworks.mlwidgets.help.CSHelpTopicMap.mapID(CSHelpTopicMap.java:234)
at com.mathworks.mlwidgets.text.mcode.MatlabDocUtils.getMapID(MatlabDocUtils.java:88)
at com.mathworks.mlwidgets.text.mcode.MatlabDocUtils.idHasExtendedHelp(MatlabDocUtils.java:83)
at com.mathworks.mlwidgets.text.mcode.MatlabDocUtils.mlintTagHasExtendedHelp(MatlabDocUtils.java:99)
at com.mathworks.mlwidgets.text.mcode.MatlabDocUtils.access$200(MatlabDocUtils.java:16)
at com.mathworks.mlwidgets.text.mcode.MatlabDocUtils$CodeAnalyzerDocHelper.hasExtendedHelp(MatlabDocUtils.java:148)
at com.mathworks.widgets.text.mcode.analyzer.CodeAnalyzerMessageModel$CodeAnalyzerMessage.hasExtendedInformation(CodeAnalyzerMessageModel.java:177)
at com.mathworks.widgets.text.layer.EditorTip.makeButtonPanel(EditorTip.java:402)
at com.mathworks.widgets.text.layer.EditorTip.makeSingleMessageRow(EditorTip.java:377)
at com.mathworks.widgets.text.layer.EditorTip.addShortMessageComponentsToPanel(EditorTip.java:257)
at com.mathworks.widgets.text.layer.EditorTip.makeWholeTipComponent(EditorTip.java:244)
at com.mathworks.widgets.text.layer.EditorTip.makeWholeTipComponentWithoutExtendedMessage(EditorTip.java:213)
at com.mathworks.widgets.text.layer.EditorTip.setupBalloonTip(EditorTip.java:199)
at com.mathworks.widgets.text.layer.EditorTip.show(EditorTip.java:504)
at com.mathworks.widgets.text.MWToolTipSupport.makeAndShowTip(MWToolTipSupport.java:351)
at com.mathworks.widgets.text.MWToolTipSupport.makeTip(MWToolTipSupport.java:253)
at com.mathworks.widgets.text.MWToolTipSupport.makeTip(MWToolTipSupport.java:216)
at com.mathworks.widgets.text.MWToolTipSupport.makeTipAtMouse(MWToolTipSupport.java:185)
at com.mathworks.widgets.text.MWKit$MWBuildToolTipAction.actionPerformed(MWKit.java:1507)
at com.mathworks.mde.editor.EditorMKit$EditorBuildToolTipAction.actionPerformed(EditorMKit.java:163)
at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:259)
at org.netbeans.editor.ext.ToolTipSupport.updateToolTip(ToolTipSupport.java:413)
at org.netbeans.editor.ext.ToolTipContext$1.updateToolTip(ToolTipContext.java:17)
at org.netbeans.editor.ext.ToolTipSupport.setToolTipVisible(ToolTipSupport.java:449)
at org.netbeans.editor.ext.ToolTipSupport.setToolTipVisible(ToolTipSupport.java:429)
at org.netbeans.editor.ext.ToolTipSupport.actionPerformed(ToolTipSupport.java:758)
at org.netbeans.editor.WeakTimerListener.actionPerformed(WeakTimerListener.java:63)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Hovering over the orange wavy underline of the following line of code
disp(sprintf('a = %d, b = %7.4f',a,b));
would give the same sort of error.
Strangely the suggestion for code like
cellfun('isempty',strfind(a,'b'))
does work.
The whole documentation also does not work. If I type, for instance:
doc plot
I will also get an error:
Error using doc>displayDocPage (line 171)
Java exception occurred:
java.lang.NullPointerException
at com.mathworks.help.helpui.DocRoot.buildUrl(DocRoot.java:197)
at com.mathworks.help.helpui.DocRoot.buildUrl(DocRoot.java:186)
at com.mathworks.help.helpui.DocRoot.buildDocSetItemUrl(DocRoot.java:59)
at com.mathworks.mde.help.DocCommandHelpBrowserTask.getUrlToDisplay(DocCommandHelpBrowserTask.java:42)
at com.mathworks.mde.help.JsHelpBrowser.doHelpBrowserTask(JsHelpBrowser.java:242)
at com.mathworks.mde.help.JsHelpBrowser.doHelpBrowserTask(JsHelpBrowser.java:238)
at com.mathworks.mde.help.JsHelpBrowser.showReferencePage(JsHelpBrowser.java:122)
at com.mathworks.mlservices.MLHelpServices.showReferencePage(MLHelpServices.java:199)
Error in doc (line 125)
if ~displayDocPage(possibleTopics) && ~showHelpwin(topic)
It seems ot me that there is something wrong with Java.
What have I done so far?
I have removed the contents of the folder:
C:\Users\<user>\AppData\Roaming\MathWorks\MATLAB\R2018b
The preferences were removed but the error persisted.
I have uninstalled Matlab completely, downloaded it again an re-installed it. The errors kept coming.
After this I installed Java manually and configured Matlab to use the new Java as discribed in:
This still made no difference.
Has anyone got any suggestions to solve this problem?
6 件のコメント
Adrien BARRET
2019 年 5 月 17 日
Hi,
I have the same error since one or two month.
Have you solved this issue?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!