You are not logged in.

#1 2022-03-24 04:28:55

iChunyu
Member
Registered: 2022-01-14
Posts: 3

[SOLVED] MATLAB cannot create or open script files

Hello there,

I installed MATLAB R2022a in my new Arch system, it works well in command window (MATLAB command line). But when I tried to open or create a script file, a dialog appear with Unable to open this file in the current system configuration, and the command line outputs error message as below

Exception in thread "AWT-EventQueue-0": java.lang.NullPointerException
	at com.mathworks.mde.desk.MLDesktop.updateTemplate(MLDesktop.java:3665)
	at com.mathworks.mde.desk.MLDesktop.access$2000(MLDesktop.java:225)
	at com.mathworks.mde.desk.MLDesktop$NewMFileAction.actionPerformed(MLDesktop.java:2853)
	at com.mathworks.mwswing.ChildAction.actionPerformed(ChildAction.java:214)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at com.mathworks.toolstrip.plaf.RegularButtonUI$RegularToolstripButtonListener.mouseReleasedImpl(RegularButtonUI.java:364)
	at com.mathworks.toolstrip.plaf.RegularButtonUI$RegularToolstripButtonListener.mouseReleased(RegularButtonUI.java:354)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6539)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at com.mathworks.mwswing.MJButton.processMouseEvent(MJButton.java:350)
	at java.awt.Component.processEvent(Component.java:6304)
	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.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	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)

This is a new system so I think it may be caused by dependencies, so I installed jre-openjdk and jdk-openjdk. Not to solve the problem.

Since Arch is not officially supported by MATLAB, I turn to this forum for helps. Thanks for your attentions and advice!

PS:  MATLAB R2022a works well in my anothor Manjaro (testing branch) system.

Last edited by iChunyu (2022-03-24 17:38:15)

Offline

#2 2022-03-24 08:10:39

j.zelinka
Member
Registered: 2016-12-05
Posts: 8

Re: [SOLVED] MATLAB cannot create or open script files

I have been using Matlab for many years and problems come almost with every new version or after some system update (actualisation glibc to version 2.35, e.g.). Some advice can be found  at Arch Linux Wiki. If you need normal Matlab script (sequence of commands) you can create it in any normal text editor (nano, pico, mcedit, gedit, etc., not libreoffice writer or something like it). You lost the possibility of easy debugging, of course.

If your problem concerns so called "live scripts", here is an advice.

JZ

Offline

#3 2022-03-24 11:41:23

allafesta
Member
Registered: 2021-05-02
Posts: 6

Re: [SOLVED] MATLAB cannot create or open script files

I've got a similar issue after I ran an update today. The following thread removed the error, but I still cannot open files (i.e. I get another error now). Also: you can use the -logfile option when starting matlab from the commandline to get a complete logfile, including warnings.
https://comp.soft-sys.matlab.narkive.co … is-corrupt

Offline

#4 2022-03-24 17:37:54

iChunyu
Member
Registered: 2022-01-14
Posts: 3

Re: [SOLVED] MATLAB cannot create or open script files

The error can be fixed by setting aside the libfreetype.so.6 in <matlab_root>/bin/glnxa64/. You may run the following command:

cd <matlab_root>/bin/glnxa64/
mv libfreetype.so.6 libfreetype.so.6.old

I happened to get the solution by another error about MATLABWindow when I tried to re-install MATLAB R2022a. However, the solution in Arch Wiki doesn't work now. And I found the official solution here. Since MATLABWindow error occurred several times on my re-installing, I think the error in this post might be due to the same reason. Likely it is.

I'm closing the post. Thanks for your attentions anyway.

Offline

#5 2022-04-12 15:04:43

iguana
Member
Registered: 2022-04-12
Posts: 1

Re: [SOLVED] MATLAB cannot create or open script files

Thanks for the solution iChunyu, I had the same problem.
I added it to the Troubleshooting section on the wiki page.

Offline

#6 2022-10-20 10:25:38

Allexj
Member
Registered: 2015-07-11
Posts: 73

Re: [SOLVED] MATLAB cannot create or open script files

Thanks, this also fixed for me!

Offline

#7 2022-10-20 11:00:12

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] MATLAB cannot create or open script files

Closing this old solved thread.

Offline

Board footer

Powered by FluxBB