0

I am new to MATLAB, learning in university. I installed MATLAB from my university license. So, no matter what I type in the command window, the command does execute, but also this long error text in red.

For example:

>> 1+1

ans =

     2

Exception in thread "AWT-EventQueue-0": java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.mlwidgets.help.HelpPrefs
    at com.mathworks.mlwidgets.help.HelpUtils.isDocInstalled(HelpUtils.java:453)
    at com.mathworks.mde.functionhints.FunctionHints.openFunctionHints(FunctionHints.java:108)
    at com.mathworks.mde.cmdwin.CmdWinEditorKit.maybeOpenFunctionHints(CmdWinEditorKit.java:1706)
    at com.mathworks.mde.cmdwin.CmdWinEditorKit.access$1000(CmdWinEditorKit.java:88)
    at com.mathworks.mde.cmdwin.CmdWinEditorKit$CWDefaultKeyTypedAction.actionPerformed(CmdWinEditorKit.java:2175)
    at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1668)
    at javax.swing.JComponent.processKeyBinding(JComponent.java:2882)
    at javax.swing.JComponent.processKeyBindings(JComponent.java:2929)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2845)
    at com.mathworks.mde.cmdwin.XCmdWndView.processKeyEvent(XCmdWndView.java:2461)
    at java.awt.Component.processEvent(Component.java:6316)
    at java.awt.Container.processEvent(Container.java:2239)
    at com.mathworks.mde.cmdwin.XCmdWndView.processEvent(XCmdWndView.java:439)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2297)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:835)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1103)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:974)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:800)
    at java.awt.Component.dispatchEventImpl(Component.java:4760)
    at java.awt.Container.dispatchEventImpl(Container.java:2297)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
    at java.awt.EventQueue$4.run(EventQueue.java:733)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)```

How can I fix it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • A similar question: *[MATLAB reports "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException"](https://stackoverflow.com/questions/25015983/)* – Peter Mortensen Mar 05 '22 at 01:45
  • Why is Java involved at all? Is it for the terminal application? – Peter Mortensen Mar 05 '22 at 01:47
  • You may consider to [add](https://stackoverflow.com/posts/71356311/edit) system information, like operating system (e.g., [Linux](https://en.wikipedia.org/wiki/Linux) or [Windows 10](https://en.wikipedia.org/wiki/Microsoft_Windows). Incl. version), distribution (incl. version), MATLAB version, Java version, and other information that may be relevant (like what type of installation system, both for MATLAB and the other components). (But ***without*** "Edit:", "Update:", or similar - the question should appear as if it was written right now.) – Peter Mortensen Mar 05 '22 at 01:52
  • @PeterMortensen This is actually a legitimate problem that also bothers me sometimes. On the desktop, the entire MATLAB GUI is handled by the Java Swing framework on top of the bundled JRE, and interacts with computational side now and then (figures, code completion, help, etc.) – X Zhang Mar 05 '22 at 08:17
  • It's likely you have some missing or broken files or bad saved configuration. The immediate remedy to this specific exception might be un-tick the Preference->Command Window->Automatic Completions->Enable function hints box, but you should check your disk and reinstall the MATLAB suit when possible. – X Zhang Mar 05 '22 at 08:27

0 Answers0