MATLAB: Unsupporte​dOperation​Exception: The first invocation of this method cannot be on the MATLAB thread.

matlab toolboxes

"C:\Program Files\MATLAB\R2017b\bin\matlab" -nodesktop -nosplash -wait -log -minimize -r "matlab.addons.toolbox.installedToolboxes();"
When I execute the above command I get this exception:
Error using matlab.addons.toolbox.installedToolboxes
Java exception occurred:
java.lang.UnsupportedOperationException: The first invocation of this method cannot be on the MATLAB thread.
at com.mathworks.addons_common.util.FolderNameUtils.getFirstFolderInUserPath(FolderNameUtils.java:57)
at com.mathworks.addons_common.util.FolderNameUtils.getUsersHomeDirectory(FolderNameUtils.java:35)
at com.mathworks.addons_common.util.settings.InstallationFolderUtils.getDefaultInstallationFolder(InstallationFolderUtils.java:77)
at com.mathworks.addons_common.util.settings.InstallationFolderUtils.getInstallationFolderForMatlabDesktop(InstallationFolderUtils.java:42)
at com.mathworks.addons_common.util.settings.InstallationFolderUtils.getInstallationFolder(InstallationFolderUtils.java:36)
at com.mathworks.toolboxmanagement.CustomToolboxManager.getInstalled(CustomToolboxManager.java:81)
This seems to only happen with 2017b, I have tested the same with 2016a 2016b and 2017a without problems

Best Answer

Not sure if this will fix it, but check out this bug and install the latest matlab Update if you haven't
Related Question