In Matlab 2021b, I get this error:
Now the support of Java is more and more removed from Matlab, we're going to lose existing functionalities. They are progressively replaced by Matlab functions, but this requires we add extra tests everywhere to handle different Matlab versions.
I added a direct FTP download for 2021b, just like I did for bst_webread, you shouldn't get this error anymore: Bugfix: Added FTP download to bst_websave for Matlab 2021b · brainstorm-tools/brainstorm3@0482142 · GitHub
Would it be possible to allow updating when the installation folder is not the default one?
In many configurations, Brainstorm would not have the access rights to the file systems. And most of all, it would be too dangerous to have Brainstorm deleting folders outside of its sandbox. We have a history of deleted desktops, we don't want this to happen ever again. And this would happen if the spm.m is on the desktop and we allow brainstorm to delete the parent folder.
Either you let Brainstorm do its thing (automatically and safely), or you do it yourself (consciously and dangerously).
Also, somehow Brainstorm often chooses to load spm8 (/usr/local/spm8), even if I did the default spm12 installation from Brainstorm previously.
This is because the SPM8 folder is in the path, therefore spm.m is found, and identified as the SPM install. Remove the SPM8 folder from your Matlab path before starting Brainstorm.
It would also be nice to allow the default install even if it was previously custom installed, perhaps when the toolbox is unloaded
Indeed, but not when the toolbox is unloaded.
We want to keep track of local installs even when they are not loaded, mostly because of plugin incompatibilities that require to load/unload them several times in a row (eg. SPM+FieldTrip).
I added a button "Ignore local installation", which is in fact only a shortcut to setting an invalid path with "Custom install > Select installation folder", but much more satisfying in terms of interface.
Plugins: Added menu: Ignore local installation · brainstorm-tools/brainstorm3@67141ff · GitHub
Does this work for you?