How to fix: java.lang.​NullPointe​rException on 5.13.19-2-MANJARO

Hey, I'm currently trying to set up MATLAB R2022a. I've had already problems installing it, where there was an issue with libfreetype.so.6. I followed this thread to fix the issue by applying the following
cd <matlabinstall>
cd /bin/glnxa64
ls | grep libfreetype
sudo mkdir exclude
sudo mv libfreetype.so.6 exclude/
I'm not sure if it has anything todo with my current issue, for the sake of clarity, however, I mention this.
When I start MATLAB I get the following error message
Warning: The desktop configuration file is corrupt or improperly formatted.
null
Warning: An error occurred while reading the desktop configuration file.
Using the default configuration.
java.lang.NullPointerException
at com.mathworks.mde.liveeditor.LiveEditorTabManager.showEditorInBrowser(LiveEditorTabManager.java:932)
at com.mathworks.mde.liveeditor.LiveEditorTabManager.handleClientDisplayed(LiveEditorTabManager.java:310)
at com.mathworks.mde.liveeditor.LiveEditorTabManager.handleClientHierarchyChanged(LiveEditorTabManager.java:276)
at com.mathworks.mde.liveeditor.LiveEditorClient$46.hierarchyChanged(LiveEditorClient.java:1885)
at java.awt.AWTEventMulticaster.hierarchyChanged(AWTEventMulticaster.java:499)
at java.awt.Component.processHierarchyEvent(Component.java:6706)
at java.awt.Component.processEvent(Component.java:6325)
at java.awt.Container.processEvent(Container.java:2239)
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.Component.createHierarchyEvents(Component.java:5555)
at java.awt.Container.createHierarchyEvents(Container.java:1448)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Container.createHierarchyEvents(Container.java:1444)
at java.awt.Component.show(Component.java:1639)
at java.awt.Window.show(Window.java:1042)
at com.mathworks.mwswing.MJFrame.show(MJFrame.java:351)
at java.awt.Component.show(Component.java:1671)
at java.awt.Component.setVisible(Component.java:1623)
at java.awt.Window.setVisible(Window.java:1014)
at com.mathworks.widgets.desk.DTFrame.setVisible(DTFrame.java:190)
at com.mathworks.widgets.desk.Desktop.showFrames(Desktop.java:359)
at com.mathworks.mde.desk.MLDesktop.showFrames(MLDesktop.java:945)
at com.mathworks.mde.desk.MLDesktop.initMainFrameFromThread(MLDesktop.java:880)
at com.mathworks.mde.desk.MLDesktop.access$600(MLDesktop.java:225)
at com.mathworks.mde.desk.MLDesktop$Initializer.run(MLDesktop.java:1237)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
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.awt.EventQueue.dispatchEvent(EventQueue.java:728)
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)
I tried to set the MATLAB_JAVA environment variable to use custom JVM
env MATLAB_JAVA=/usr/lib/jvm/java-8-openjdk/jre matlab
and
env MATLAB_JAVA=/usr/lib/jvm/java-18-openjdk matlab
to no avail.
Starting MATLAB with -nodesktop or -nojvm seems to work.

 Accepted Answer

Okay, I fixed this and in fact, the libfreetype.so.6 had something to do with it. After installation, you have to repeat the same you did for installation
cd <matlabroot
cd /bin/glnxa64
ls | grep libfreetype
sudo mkdir exclude
sudo mv libfreetype.so.6 exclude/
I think the java errors are only occurring because Matlab can't open the desktop. That's why it works with nodesktop and nojvm.

1 Comment

Thanks! It also worked for me and I was using Fedora 37 while encountering this error.

Sign in to comment.

More Answers (2)

cd <matlabroot ; cd /bin/glnxa64 ; ls | grep libfreetype ; sudo mkdir exclude ; sudo mv libfreetype.so.6 exclude/
dose not work for me

Categories

Products

Release

R2022a

Asked:

on 4 Jul 2022

Answered:

on 11 Sep 2024

Community Treasure Hunt

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

Start Hunting!