MATLAB Answers

2

Why do I receive an error when starting MATLAB which states: Fatal Error on startup: Java exception occurred: java.lang.​NoClassDef​FoundError​: Could not initialize class com.mathwo​rks.servic​es.binding​.MatlabKey​Bindings

MathWorks Support Team さんによって質問されました 2015 年 7 月 29 日
最新アクティビティ Walter Roberson
さんによって 編集されました 2019 年 5 月 9 日
I am starting MATLAB on a UNIX-based system and I am receiving the following error: Fatal Error on startup: Java exception occurred: 
java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.services.binding.MatlabKeyBindings. How can this be resolved?

タグ

タグが未入力です。

製品


リリース

R2015a

5 件の回答

回答者: MathWorks Support Team 2018 年 2 月 2 日
 採用された回答

This error indicates that MATLAB is not able to locate or read your MATLAB preferences directory. This could be due to a setting or variable on your system which is causing MATLAB to look for your preferences in a location where you do not have read access.
Typically this happens due to running a configuration script for MATLAB such as ‘config_matlab.sh’ which attempts to set your preferences directory to a non-default location where you do not have read or write access. You should start by removing the portion of the script which sets your environment variable.
This can also be resolved by creating an environment variable to specify your MATLAB preferences directory immediately before starting MATLAB. You should choose a directory where you have both read and write access. The default location is in your home folder. As an example of the command to run before starting MATLAB, see the following:
Linux
export MATLAB_PREFDIR=~/.matlab/R2015a
/usr/local/MATLAB/R2015a/bin/matlab
Mac
export MATLAB_PREFDIR=~/.matlab/R2015a
/Applications/MATLAB_R2015a.app/bin/matlab
This command sets your MATLAB preferences directory to be the default directory inside your home folder. Then, on the next line, the command is to launch MATLAB.
If you continue to encounter this error, please contact MathWorks support for assistance.

  3 件のコメント

The above bit about environment variables is for OS-X/MacOS and for Linux, and assumes that the user is using a shell derived from ksh . However, ksh and derivatives are case sensitive, and the command in them is export rather than Export . Also the second line needs to begin with /
export MATLAB_PREFDIR=~/.matlab/R2015a
/usr/local/MATLAB/R2015a/bin/matlab
/usr/local/MATLAB is used for Linux but in OS-X /MacOS the equivalent would be
/Applications/MATLAB_R2015a.app/bin/matlab
How to solve the same problem occurring on Windows 10 platform?

サインイン to comment.


回答者: Hobin Lim
2016 年 7 月 3 日

I got this message when my hard disk was full.

  0 件のコメント

サインイン to comment.


回答者: David
2015 年 8 月 31 日

I want to report another common reason matlab on linux would be unable to read the preferences file. I often run matlab over a VPN I establish to the head node of a computer cluster. I then use matlab to submit parallel jobs to the compute nodes. Sometimes, I'll have more than one VPN tunnel established at once- one from a work computer, then later another from my laptop, or maybe from a different work computer. None of my tunnels can see the other's applications, so I end up running multiple copies of matlab operating out of my same user folder.
If one matlab opens the preference file for writing, perhaps because I made a change to the window arrangement, then when I attempt to open the second matlab through a different terminal, I receive this error.
If this applies to anyone else, the solution is that if you change the preferences in one instance of matlab, reboot this one before trying to open other instances. If you already have multiple instances running when you change the preferences from one instance, the others will stay open, but will throw this error when you try to reboot them.

  0 件のコメント

サインイン to comment.


回答者: ibrahim Hasan 2018 年 4 月 16 日

I have the same error , in windows 10 any solution please

  1 件のコメント

Hi,
If you are still experiencing this issue, please contact MathWorks support:
-Justin

サインイン to comment.


回答者: bennibenjamin 2018 年 7 月 16 日

I have encountered the same error on Ubuntu 16.04 with R2016b. Running the command
export MATLAB_PREFDIR=~/.matlab/R2016b
and
/usr/local/MATLAB/R2016b/bin/matlab
afterwards still yields:
Fatal Error on startup: Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.services.binding.MatlabKeyBindings
at com.mathworks.widgets.debug.DebuggerManager$ActionShell.<init>(DebuggerManager.java:194)
at com.mathworks.widgets.debug.DebuggerManager$ActionShell.<init>(DebuggerManager.java:190)
at com.mathworks.widgets.debug.DebuggerManager$DebuggerShellActions$1.<init>(DebuggerManager.java:97)
at com.mathworks.widgets.debug.DebuggerManager$DebuggerShellActions.<clinit>(DebuggerManager.java:97)
at com.mathworks.widgets.debug.DebuggerManager.getStepAction(DebuggerManager.java:262)
at com.mathworks.mde.desk.MLDesktop.<init>(MLDesktop.java:586)
at com.mathworks.mde.desk.MLDesktop.getInstance(MLDesktop.java:616)
Any ideas how to solve that?

  1 件のコメント

I solved the problem by reinstalling Matlab, which only works when I also delete the configuration files in my home directoy (.matlab).

サインイン to comment.



Translated by