Why is MATLAB unable to run the MATLABWindow application on Linux?

653 views (last 30 days)
Why is MATLAB unable to run the MATLABWindow application on Linux, with the following warning?
>> simulink
Warning: MATLABWindow application failed to launch. Unable to launch the MATLABWindow application

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 13 Apr 2023
Edited: MathWorks Support Team on 13 Apr 2023
There are a few things that can cause MATLABWindow to not open correctly.
1. 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". There is not a comprehensive list of every library MATLAB needs in order to function on Linux.Another approach you can take is setting up an environment variable that uses one of the libraries that MATLAB ships with, instead of the Operating System's libraries. An example would be to run this command in the Linux Terminal to setup an environment variable if the library "libstdc++.so.6" is causing issues:
export LD_PRELOAD="/home/local/MATLAB/R2020b/bin/glnxa64/glibc-2.17_shim.so".
There is no exhaustive list of the libraries that MATLAB depends on from the Operating System nor which ones can be substituted with the ones that MATLAB ships with.
2. Permissions
Make sure the user running MATLAB has permissions to access and execute folders and files from MATLAB's installation directory.

Sign in to comment.

More Answers (1)

József Mózer
József Mózer on 8 Jan 2021
I had an error that was not documented on support pages at all, but was very similar to this one. It propped up after I solved issue number 2 in this thread when attempting to launch Simulink.
This solution worked for me on R2019b, but since the issue is consistent it should work with all recent MATLAB releases as well as all Linux distributions. As it turns out, there has been a problem with the Add-on Manager of MATLAB for a while now, causing these issues. Here's the solution in case you don't want to read the details. Also it is uncessary to redirect the symlinks as described on the Wiki, it is enough to exclude them from the matlabroot folder so MATLAB will use system-defaults.
Here's the process, run commands as root when prompted:
cd /usr/local/MATLAB/R2019b/cefclient/sys/so/glnxa64 # default location for this
mkdir exclude
Now enter the commands to remove the symlinks causing the errors.
mv libgio-2.0.so* exclude
mv libglib-2.0.so* exclude
mv libgmodule-2.0.so* exclude
mv libgobject-2.0.so* exclude
mv libgthread-2.0.so* exclude
Your problem should be solved. This shouldn't break anything either, since more up-to-date system defaults exist for these libs. You should also make a README file, so you know what you did and why in case you need to come back a year later or something.
I would also like to state, that I am severely disappointed in MATLAB and Mathworks. Providing a .zip file for installation on systems with very well made package management is dumb and annoying. Shipping an expensive piece of commercial software on an operating system claiming it works, while it needs workarounds is straight up outrageous.


Find more on Introduction to Installation and Licensing in Help Center and File Exchange


No tags entered yet.




Community Treasure Hunt

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

Start Hunting!