Why I got error 'No display available', even though I run MATLAB with '-nodisplay'?

68 次查看(过去 30 天)
I am installing MATLAB R2022b for my Linux server with CentOS7.5. The OS of my local host is macOS 13.3.1.
I think I have installed the MATLAB sucessfully, because the log file told me so. However, when I input
matlab -nodisplay
I got errors
ps terminate called after throwing an instance of 'framework::window::DisplayError'
what(): No display available.
/home/MatlabR2022b/bin/glnxa64/MathWorksProductAuthorizer.sh: line 14: 45354 aborted
$BINDIR/MathWorksProductAuthorizer $@
It seems that MATLAB needs something to display. Indeed, my MacBook does not have an X server (like XQuartz). But I am runing MATLAB with nodisplay, why I need a screen to display GUI? How can I fix these problems?
PS: When I use a host with Xserver (MobaXterm in a Windows laptop), the above error disappears. But a new problem comes up: there is no output (including character output) at all! In this case, the command 'ps' shows that several processes of MATLABWindow and MathWorksProduct are runing.
So, I think MATLAB is sucessfully launched without any output. I can't quit MATLAB normally, the only way I can use in such a case is
kill -9 $(ps| grep MATLAB)
kill -9 $(ps| grep MathWorks)
I don't think there are any problem of Xserver, the GUI of firefox in my server works well.

采纳的回答

Gokul Nath S J
Gokul Nath S J 2023-5-24
Hi Tanpna,
Please note that this can be caused by multiple things, including the following:
1. Running Installer as Root
It is often advised not to run GUI programs on Linux as the root user. If you must run the installer as the root user and are unable to do so, please visit the following MATLAB Answer to resolve the issue.
https://in.mathworks.com/matlabcentral/answers/133944-why-can-t-i-install-matlab-with-the-root-account-in-linux-when-the-installer-works-for-my-user-accou
2. Missing Libraries
Under normal conditions, supported Linux distributions should have all the libraries needed in the Operating System to run MATLAB and the installer. However, for a variety of reasons, some may be missing on your computer. To ensure that you have the correct libraries installed with your supported Linux distribution, navigate into the folder the installer is in, then the "bin" folder, and then the "glnxa64" folder. In this folder, there is an application called MATLABWindow. If you launch this program with ./MATLABWindow and you are missing libraries, you will see those missing libraries appear in the error message. Use your Linux distribution's package manager to install the missing libraries (such as apt, dnf, yum, or pacman.) If you are unsure what packages include the library you are missing, use your distribution's package search to find a package that contains the library you are missing. For example, if you are missing "libgtk-x11-2.0.so.0" on Ubuntu, use Ubuntu's package search site to search for the appropriate package, and then install it with "sudo apt install libgtk2.0-0". Please find the following link for the Ubuntu's package search.
3. Permissions
Make sure the user running MATLAB has permissions to access and execute folders and files from MATLAB's installation directory.
4. Display configuration issues
Make sure that you have display forwarding setup and/or a display environment variable setup. This will vary depending on your Linux distribution, displaying forwarding method, and how you are connecting to the Linux server. If you already have display forwarding setup, try running "export DISPLAY=:0" in Terminal.
with regards,
Gokul Nath S J
  1 个评论
tanpna
tanpna 2023-5-24
Thanks for your patient answer. Actually, I fixed the problem by reinstalling MATLAB. (I remembered that I asked to delete this problem, but somehow it is still here. Sorry for taking up your time.) So I cannot verify whether your answer works for the problem. But I will accept your answer anyway.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by