Clear Filters
Clear Filters

How can i solve this problem?

45 views (last 30 days)
Alex Fogli
Alex Fogli on 9 Jul 2021
Answered: Kiran Felix Robert on 12 Jul 2021
Exception in thread "Startup Class Loader": java.lang.NoClassDefFoundError: Could not initialize class com.mathworks.instutil.InstutilResourceKeys
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at com.mathworks.mlservices.MLHelpServices.getDocRoot(
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.getDocrootDirectory(
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.getAbsolutePath(
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.parseFile(
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.parseFiles(
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$
Every time i type something this code appears on my screen and i don't know what is resolution for this issue... can somebody help me???
I'm using windows 10 with the latest version of matlab... the r2021a...

Answers (1)

Kiran Felix Robert
Kiran Felix Robert on 12 Jul 2021
Hi Alex,
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.


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!