Error when trying to use WFDB toolbox and Brainstorm at the same time

Dear all,
I am trying to do ECG analysis using WFDB toolbox and bring back the results to do further analysis with EEG.
When I first run brainstorm and then try to run WFDB toolbox


And when I first use the wfdb toolbox and then open the brainstorm the same issue also happens.

>> sig=main_sig'/1e3;
gain = (10^4)/max(max(abs(sig))); % I am scaling ECG signal to int64
new_sig = int64(sig*gain);
tm=int64(0:size(new_sig,1)-1)';
wrsamp(tm,new_sig,'test',1024,gain);
>> %% This time it created the signal as it should
>> brainstorm

Warning: Objects of org/physionet/wfdb/Wfdbexec class exist - not clearing java 
> In javaclasspath>local_javapath (line 195)
  In javaclasspath (line 124)
  In javaaddpath (line 71)
  In brainstorm (line 101) 

Warning: Objects of org/physionet/wfdb/Wfdbexec class exist - not clearing java 
> In javaclasspath>local_javapath (line 195)
  In javaclasspath (line 124)
  In javaaddpath (line 71)
  In brainstorm (line 102) 
 
BST> Starting Brainstorm:
BST> =================================
BST> Version: 12-Apr-2023
BST> Compiling main interface files...
BST> Deleting old process reports...
BST> Loading configuration file...
BST> Warning: Automatic updates are disabled.
BST> Warning: Make sure your version of Brainstorm is up to date.
BST> Initializing user interface...

> Undefined variable "IconLoader" or class "IconLoader.ICON_APP.getImage".

> Error in gui_brainstorm>CreateWindow (line 83)
    jBstFrame.setIconImage(IconLoader.ICON_APP.getImage());

> Error in gui_brainstorm (line 34)
eval(macro_method);

> Error in gui_initialize (line 30)
GlobalData.Program.GUI = gui_brainstorm('CreateWindow');

> Error in bst_startup (line 359)
gui_initialize();

> Error in brainstorm (line 123)
        bst_startup(BrainstormHomeDir, 1, BrainstormDbDir);

Any guidance on how to solve this issue would be much appreciated.

It seems there is a problem the file /java/brainstorm.jar, it may not be there or it may be corrupted.

See this link: Update matlab 2024a 2023a - #3 by Raymundo.Cassani

P.S. Use a recent version of Brainstorm as we frequently add improvements, new features, and bugfixes.

Thank you.
But , I should have also mentioned that each toolbox works as normal when they are opened seperately.
Also I don't know if it is important but I am using matlab 2018.

Thanks for the extra info, I assumed there were issues even with starting Brainstorm

The issue is that WFDB and Brainstorm .jar files have the same package name org. Thus they cannot be loaded at the same time. In addition some objects are from both exist (hence the warnings), so it is not possible to clear the java classpath.

Is there any reason you need to to run both at the same time?

Would it be possible to save the signal from WFDB in the disk, then restart Matlab and open the signal file in Brainstorm?

I am hopefully planning this function for future uses. And the lab does almost everything via brainstorm. So the idea is that it would be great if we can call this analysis directly from brainstorm. And continue from there. The ECG and EEG files and other analyses are already on the brainstorm. I need to get the signals from brainstorm. Then close open matlab. Do the ECG analysis close open matlab. And upload to the brainstorm. Which disables the batch processing and creates a bottleneck in the analysis.

I am still looking for a solution for this issue. Any suggestions will be appreciated