What is the cause of "Could not initialize class com.mathwo​rks.hg.uti​l.HGPeerQu​eue" java error?

7 次查看(过去 30 天)
Hello, I am experiencing a major breakdown of Matlab's functionality due to a series of errors, which relate to a group of java.lang.NoClassDefFoundError errors.
They occur in following situations (found so far):
1. on opening .fig files
> Error using textwrap (line 82)
> Java exception occurred: java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.hg.util.HGPeerQueue
> at com.mathworks.hg.util.HGUtils.invokeLater(HGUtils.java:59)
> at com.mathworks.hg.peer.FigurePeer.causeExpose(FigurePeer.java:2948)
> Error in msgbox (line 273)
[WrapString,NewMsgTxtPos]=textwrap(MsgHandle,BodyTextString,75);
> Error in errordlg (line 47)
handle = msgbox(ErrorStringCell,DlgName,'error',Replace);
> Error in uiopen (line 187) errordlg(ex.getReport('basic', 'hyperlinks', 'off'));
2. on opening .xls files from directory
(same error mssg as in point 1)
3. on creating a figure
>> figure
> Java exception occurred: > java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.hg.util.HGPeerQueue
> at com.mathworks.hg.util.HGUtils.invokeLater(HGUtils.java:59)
> at com.mathworks.hg.peer.FigurePeer.causeExpose(FigurePeer.java:2948)
4. on opening GUIDE
>> guide
> Error using javacomponentundoc_helper (line 112)
> Java exception occurred:
> java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.hg.util.HGPeerQueue
> at com.mathworks.hg.util.HGUtils.invokeLater(HGUtils.java:59)
> at com.mathworks.hg.peer.FigureChild.add(FigureChild.java:56)
> at com.mathworks.hg.peer.UIComponentManager.addchild(UIComponentManager.java:155)
> at com.mathworks.hg.peer.UIComponentManager.addchild(UIComponentManager.java:149)
> at com.mathworks.hg.peer.FigurePanel.addchild(FigurePanel.java:301)
> at com.mathworks.hg.peer.FigureMediator.addchild(FigureMediator.java:414)
> at com.mathworks.hg.peer.FigurePeer.addchild(FigurePeer.java:1115)
> Error in javacomponent (line 113)
> [hcomponent, hcontainer] = javacomponentundoc_helper(varargin{:});
> Error in guidetemplate (line 25)
> [jc, hc] = javacomponent(quickstartpanel, [], hDialog);
> Error in guide (line 69)
> guidetemplate;
5. on plotting
>> plot(x,y)
> Error using clo (line 79)
> Java exception occurred:
> java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.hg.util.HGPeerQueue
> at com.mathworks.hg.util.HGUtils.invokeLater(HGUtils.java:59)
> at com.mathworks.hg.peer.FigurePeer.causeExpose(FigurePeer.java:2948)
> Error in cla (line 35)
> clo(ax, extra{:});
> Error in newplot>ObserveAxesNextPlot (line 124)
> cla(ax, 'reset',hsave);
> Error in newplot (line 73)
> ax = ObserveAxesNextPlot(ax, hsave);
I am really desperate for a solution to this problem as it preventing any substantial work with Matlab.
Help greatly appreciated.
  1 个评论
Jakub Kozlowski
Jakub Kozlowski 2015-7-22
I should add that I work with an external LCD display and, at the same time, laptop's screen disabled and all has been working just fine for almost a year, until last week when I plugged a different display to my laptop. Even then all was OK, but when I returned to using initial display all those errors occurred.

请先登录,再进行评论。

回答(2 个)

Heber Kaiser
Heber Kaiser 2015-7-23
Jakub,
I am having the same trouble, although I did not any changes to my computer. It's something about update, either Matlab or Java. I tried to use Matlab in another computer with Win7, and the problems still.
--- Win Vista, Matlab 2014a
  1 个评论
Jakub Kozlowski
Jakub Kozlowski 2015-7-23
Heber,
I updated java to the latest version but it solved nothing. I only think that the situation with swaping displays is the root of my problem because it seems these errors are somewhat related to how the software displays things (i.e. 'error using textwrap', 'error using newplot' and so on...). I'm also working on Win Vista and Matlab 2014a.
I just hope that the fix isn't going to be Matlab reinstallation because I don't see how I can do it every time I need to plug a different display, be it a monitor or projector.

请先登录,再进行评论。


Finley Gibson
Finley Gibson 2015-8-14
Exact same problem here. Added no new hardware, just happened overnight.
Tried updating java, Tried a complete reinstall of Matlab,
No luck.
  2 个评论
Steven Lord
Steven Lord 2015-8-14
Please contact Technical Support (using the Contact Us link in the upper-right corner of mathworks.com) and work with them to determine the cause of this behavior.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by