About two months ago, I was able to run
ImageJ.m successfully on MATLAB R2017b. Now I cannot do the same on R2018a. I’ve seen this issue reported here, but because the JAVA version is already 1.8, the same solution would not work for me.
>> javaclasspath DYNAMIC JAVA PATH ... D:\Fiji.app\jars\imagej-matlab-0.7.2.jar ... D:\Fiji.app\jars\scripting-matlab-0.5.1.jar ... >> version -java ans = 'Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode' >> ImageJ Undefined variable "ImageJMATLAB" or class "ImageJMATLAB.start". Error in ImageJ (line 42) ImageJMATLAB.start(); 42 ImageJMATLAB.start();
When I look at the source code of
ImageJ.m , I found an alarming comment.
%% Maybe open the ImageJ window import net.imagej.matlab.*; if open_imagej ImageJMATLAB.start(); else % initialize ImageJ with the headless flag ImageJMATLAB.start('--headless'); end % Make sure that the scripts are found. % Unfortunately, this causes a nasty bug with MATLAB: calling this % static method modifies the static MATLAB java path, which is % normally forbidden. The consequences of that are nasty: adding a % class to the dynamic class path can be refused, because it would be % falsy recorded in the static path. On top of that, the static % path is fsck in a weird way, with file separator from Unix, causing a % mess on Windows platform. % So we give it up as now. % % imagej.User_Plugins.installScripts();
What does this mean? ImageJ.m won’t work now? Or am I doing something wrong?