Hello Francois,
I believe that I am having a similar issue to what the above user has described. If you prefer that I start a different thread, please let me know. Here are the details:
I am trying to run the brainstorm binary version using MATLAB Runtime 2022b on a Windows 10 machine.
When I try to execute it using the brainstorm3.bat file, I get the following output in the command line:
MATLAB 2022b found
ECHO is on
ERROR: java.exe was not found in \sys\java\jre\<arch>\jre\bin
The path to the '.java exe' file on my computer is: 'C:\Program Files\MATLAB\MATLAB Runtime\R2022b\sys\java\jre\win64\jre\java.exe'
I am trying to follow troubleshooting instructions at two of your links, which I have pasted below. I understand that the solution is to edit the path for @SET MATLABROOT, in the brainstorm3.bat file.
However, I don't know which @SET MATLABROOT line to edit + what path to paste in it. Would you be able to clarify this?
Okay, I confirmed two things and solved my problem for now:
From the Mathworks, I installed their MCR 2020a for win64, and I had no problems running Brainstorm 2020a (bst_bin_R2020a_230223).
But I see that Mathworks installed that version into v98, while Mathworks install MCR 2022b into R2022b, instead of v98.
C:\Program Files\MATLAB\MATLAB Runtime\R2022b
vs
C:\Program Files\MATLAB\MATLAB Runtime\v98
So I went into your brainstorm3.bat file in (bst_bin_R2022b_230130)
..\bst_bin_R2022b_230130\brainstorm3\bin\R2022b
and altered the single line in the header of your script from @ECHO. @SET MATLABROOT= @SET VER_NAME=R2022b @SET VER_NUMBER=9.13 @SET MCR_FOLDER=v913
to
@SET MCR_FOLDER=R2022b
and your brainstorm3.bat file worked perfectly.
I can only guess that Mathworks has done another default change in the way that MCR files are installed. If you can confirm the same, you may need to change the distributed brainstorm3.bat file?
It looks like the default installation path of the Matlab Runtime changed, indeed. I think this is better this way, as "9.13" makes no sense to someone who installed the "Runtime 2022b".
The first part of of the brainstorm3.bat tries to get the MATLABROOT folder from standard installation paths. I added here two more tests for trying to find the Matlab Runtime installation paths (VER_NAME=R2022b):
And here's the startup of 2022b on my machine. I don't see any errors posted, nor have I encounted any, but I have not extensively tested this binary version.
Matlab R2022b found:
C:\Program Files\MATLAB\MATLAB Runtime\R2022b
Please wait...
If it hangs for more than a few minutes: try pressing ENTER.
Alternatively, download Brainstorm for a different version of the Matlab Runtime.
(See the installation instructions on the Brainstorm website)
BST> Starting Brainstorm:
BST> =================================
BST> BrainstormHomeDir = C:\Users\jmosher\AppData\Local\Temp\jmosher\mcrCache9.13\bst_ja0\bst_javabuil
BST> Version: 28-Jan-2023
BST> Compiling main interface files...
BST> Deleting old process reports...
BST> Loading configuration file...
BST> Initializing user interface...
BST> Starting OpenGL engine... hardware
BST> Plugin [...]
BST> Reading process folder...
BST> Loading current protocol...
BST> =================================
This illustrates the change: previously, the registry entry indicated only the path up to "MATLAB Runtime", so my batch script was adding the missing version folder (e.g. "v98").
Now, the installer registers the path including the version name (R2022b). This cause the script to generate the erroneous path you reported in your first post: C:\Program Files\MATLAB\MATLAB Runtime\R2022b\v913
Changes in Matlab are always annoying because it makes me work extra. But this one is actually fixing a "bug" of the previous installers.
Please update the Brainstorm bin package and try again running the brainstorm3.bat without any modification.
This error is different : the path was not found in the registry, but it didn't report it wasn't found. I don't understand this...
Can you please try the following: save the script below as a file "getpath.bat", then double-click on it to execute it, and finally copy-paste here the full output. If the window closes too fast: open a CMD terminal, CD to the folder where the .bat file is saved, and execute it from the command line. test.zip (394 Bytes)
@REG QUERY "HKLM\SOFTWARE\MathWorks\MATLAB Runtime" /s
@SET MATLABROOT=
@SET VER_NUMBER=9.13
@SET MKEY="HKLM\SOFTWARE\MathWorks\MATLAB Runtime\%VER_NUMBER%"
@ECHO GET %MKEY%
@ECHO.
@FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY %MKEY% /v MATLABROOT 2^>NUL') DO @SET MATLABROOT=%%B
@IF DEFINED MATLABROOT (
@ECHO Matlab found:
@ECHO MATLABROOT=%MATLABROOT%
@GOTO :END
)
@ECHO Matlab not found.
:END
@Francois, I re-downloaded/reinstalled the Brainstorm bin package as you suggested above, and now it is working. Thanks to you and @John_Mosher for working through this.
Anyhow, here is the output you requested from executing test.bat:
I downloaded your .bat file from github and used it in place of the original. Worked fine!
I ran with a fellow for awhile and encountered one error, apparently unrelated to this, so I'll make a new topic. But otherwise, your new .bat file fixed the issue, thanks!