R2021a can't use Help, and reported failure. Can't set the preference - Help
7 次查看(过去 30 天)
显示 更早的评论
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.help.DocCenterRoot.initDocRelease(DocCenterRoot.java:44)
at com.mathworks.mlwidgets.help.DocCenterRoot.<clinit>(DocCenterRoot.java:26)
at com.mathworks.mlwidgets.help.HelpPrefs.<clinit>(HelpPrefs.java:56)
at com.mathworks.mlwidgets.help.DocLocaleValidator.isLocalizedDocInstalled(DocLocaleValidator.java:120)
at com.mathworks.mlwidgets.help.DocLocaleValidator.canOverrideDocLocale(DocLocaleValidator.java:90)
at com.mathworks.mlwidgets.help.DocLocaleValidator.initAllowedLanguageLocales(DocLocaleValidator.java:57)
at com.mathworks.mlwidgets.help.DocLocaleValidator.<init>(DocLocaleValidator.java:53)
at com.mathworks.mlwidgets.help.StartupLocalizationModelBuilder.buildDocLocaleValidator(StartupLocalizationModelBuilder.java:145)
at com.mathworks.mlwidgets.help.StartupLocalizationModelBuilder.validateLanguageLocale(StartupLocalizationModelBuilder.java:137)
at com.mathworks.mlwidgets.help.StartupLocalizationModelBuilder.buildModel(StartupLocalizationModelBuilder.java:95)
at com.mathworks.mlwidgets.help.DocCenterLocalizationPrefs$DefaultDependencyProvider.buildInitialLocalizationModel(DocCenterLocalizationPrefs.java:256)
at com.mathworks.mlwidgets.help.DocCenterLocalizationPrefs.buildInitialLocalizationModel(DocCenterLocalizationPrefs.java:35)
at com.mathworks.mlwidgets.help.DocCenterLocalizationPrefs.initializeLocalizationModel(DocCenterLocalizationPrefs.java:31)
at com.mathworks.mlwidgets.help.DocCenterLocalizationPrefs.getLocalizationModel(DocCenterLocalizationPrefs.java:24)
at com.mathworks.mlwidgets.help.DocCenterLocalizationPrefs.getLanguageLocale(DocCenterLocalizationPrefs.java:143)
at com.mathworks.mlwidgets.help.HelpUtils.getActiveLanguageLocale(HelpUtils.java:109)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.pathChanged(ProductInfoUtils.java:130)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.<init>(ProductInfoUtils.java:80)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.getAllProductsInfo(ProductInfoUtils.java:900)
at com.mathworks.mlwidgets.util.productinfo.ProductInfoUtils.<clinit>(ProductInfoUtils.java:66)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.mathworks.mde.desk.StartupClassLoader$LoadInfo.<init>(StartupClassLoader.java:112)
at com.mathworks.mde.desk.StartupClassLoader.createLoadInfos(StartupClassLoader.java:202)
at com.mathworks.mde.desk.StartupClassLoader.access$500(StartupClassLoader.java:25)
at com.mathworks.mde.desk.StartupClassLoader$2.run(StartupClassLoader.java:223)
at java.lang.Thread.run(Thread.java:748)
0 个评论
回答(1 个)
Swetha Polemoni
2021-9-15
Hi,
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!