linux服务器运行matlab文件报错
在linux服务器上安装matlab之后,如果想要运行matlab程序,通常的做法是先cd到matlab文件所在的文件夹,然后输入指令
% 假定matlab文件名为XXX.m,需要注意的是下面这条指令是写XXX,不要加上后缀名.m
matlab -nodesktop -nosplash -r XXX
问题描述
有时候可能会遇到这样的报错信息:
Internal Error: No write permission on directory matlab_path. Details: fl:filesystem:AccessDenied.
at com.mathworks.mlwidgets.prefs.InitialWorkingFolder.setStringSettingValue(InitialWorkingFolder.java:52)
at com.mathworks.mlwidgets.prefs.InitialWorkingFolder.access$000(InitialWorkingFolder.java:15)
at com.mathworks.mlwidgets.prefs.InitialWorkingFolder$1.actionPerformed(InitialWorkingFolder.java:34)
at com.mathworks.jmi.MatlabPath$DeferredActionEvent.dispatch(MatlabPath.java:152)
at com.mathworks.util.QueueEvent$QueueTarget.processEvent(QueueEvent.java:89)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(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$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.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)
解决方案
这个链接给出了可行的解决方案。
Step1 转到/usr/local/MATLAB/R2019a/bin/文件夹(输入matlab的安装路径)
Step2 将.matlab7rc.sh的权限设置为最高权限
sudo chmod 777 .matlab7rc.sh
Step3 将含有’‘LDPATH_PREFIX=’
M
A
T
L
A
B
/
s
y
s
/
o
p
e
n
g
l
/
l
i
b
MATLAB/sys/opengl/lib
MATLAB/sys/opengl/lib/ARCH’'的三行位置取消注释
重新运行matlab文件即可。