Clear Filters
Clear Filters

R2021a can't use Help, and reported failure. Can't set the preference - Help

5 views (last 30 days)
After instualling Matlab R2021a, the help can't be used, and errors occured like following:
Exception in thread "Startup Class Loader": java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.instutil.InstutilResourceKeys
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.pathChanged(
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.<init>(
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.getAllProductsInfo(
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.<clinit>(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at com.mathworks.mde.desk.StartupClassLoader$LoadInfo.<init>(
at com.mathworks.mde.desk.StartupClassLoader.createLoadInfos(
at com.mathworks.mde.desk.StartupClassLoader.access$500(
at com.mathworks.mde.desk.StartupClassLoader$

Answers (1)

Swetha Polemoni
Swetha Polemoni on 15 Sep 2021
The "NoClassDefFoundError" error is thrown because MATLAB was not able to locate Java Runtime libraries that are used by the Integrated Development Environment (MATLAB IDE).
There are several possible causes to this issue:
A. The installation is corrupted and there are .jar files missing from the MATLAB installation folder.
B. The classpath.txt file is missing references to Java Runtime libraries.
C. One or several internal MATLAB functions are shadowed by custom functions.
Let us start from the bottom (C):
1. Are there M-files on the MATLAB search path with the same name as internal MATLAB functions?
The search path defines the location where MATLAB looks for an M-file. For example, if I type "plot(1:10)" at the command line, MATLAB looks in all the folders on the search path for an M-file with the name "plot.m". If several files named "plot.m" exist, MATLAB uses the one at the top of the search path (the first one it encounters). If I create my own "plot.m" function and save it in the start-up folder, this file will be at the top of the search path and MATLAB will call it every time "plot" is used in MATLAB. This is what we call "shadowing."
To take a look at the MATLAB search path, execute "pathtool" in the Command Window. This will open up the Set Path window with the list of folders that MATLAB parses. The start-up folder should be at the top.
You can try to restore the search path to the installation default by executing the following commands:
>> restoredefaultpath
>> rehash toolboxcache
>> savepath
However, this will not remove the start-up directory from the MATLAB search path. If the start-up folder contains M-files, try to remove them or move them to another folder which is not on the search path.
2. If the issue still persists, the installation might be corrupted. Remove MATLAB completely and install it again to resolve the issue.
  1 Comment
琳炜 高
琳炜 高 on 22 Sep 2021
Thank you for your kind support! Finally, I re-installed MATAB module, and this issue solved, thanks!

Sign in to comment.


Find more on Startup and Shutdown in Help Center and File Exchange



Community Treasure Hunt

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

Start Hunting!