- To install, you can do the following at your linux command line:
Problem with JAVA I guess
44 views (last 30 days)
I have installed MATLAB 2018b, I am running it on Ubuntu 20.04. Whenever I start the mATLAB, I get the below error-
PostVMInit failed to initialize com.mathworks.mwswing.MJStartupForDesktop
/bin/bash: run: command not found
Also, I am not able to see any workspace variables. I get a long error starting with-
Exception in thread "AWT-EventQueue-0": java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.mwswing.MJStartupForDesktop
I installed MATLAB 2020a and 2020b, I have same issues with them. I tried using default JAVA shipped from MATLAB, openjdk8, openjdk11 and openjdk15, nothing resolved. It would be grateful if someone could help me with this. I am not able to see any workspace variables.
Manish Mahalwal on 2 Dec 2020
Edited: Manish Mahalwal on 2 Dec 2020
The NoClassDefFoundError is a specific Java error having to do with the static class initialization. I have attached a patch which should resolve the issue. I had to zip the file because MATLAB Answers doesn't support *.tar, so unzip the file first.
%% Save the mwswingPatch3.tar file to your matlabroot/java directory
% cd <matlab root>/java
% tar xvf mwswingPatch3.tar
2. Then you should restart MATLAB.
3. You should see the following messages at the top of the command line:
MJStartupForDesktop.init - done
If for some reason there is an error, you can remove the patch by doing the following to remove the java/patch directory which was created by the patch above:
% cd <matlab root>/java
% rm -rf patch
Hope this helps.
Larry Stern on 15 Dec 2020
This sounds very much like the same issue I diagnosed on windows version of MATLAB. Cisco amp deletes one file, glugen-rt.jar located in Matlab’s \java\jarext folder.
Depending on your organization’s amp settings, the amp administrator will need to add that file to their exclusion list.
Once that happens you can copy the one file back. And then MATLAB will work correctly again.
I also opened a ticket with mathworks tech support and they are going to get their engineering team to communicate with Cisco so that the global community will not run into this issue.
Manish Mahalwal on 10 Mar 2021
For MATLAB R2020a on Ubuntu 20.
I have attached a patch which should resolve the issue. I had to zip the file because MATLAB Answers doesn't support *.tar, so unzip the file first.
1. In MATLAB, execute the following command and make a note of its location:
2. Exit from MATLAB.
3. Copy attached "mwswingPatch2020a.tar" to "matlabroot" directory.
4. Unpack the tar file by executing the following command at the Linux command line:
>> tar xvf mwswingPatch2020a.tar
5. Start MATLAB
If for some reason there are any issues, the patch can be removed by doing the following to remove the java/patch directory which was created by the patch above:
1. From the linux command line, cd to the "matlabroot".
2. Run the following command:
>> rm -rf java/patch