1

我正在尝试从 Jetbrains MPS 调用 MATLAB 函数。但是,我收到此错误:

本机库 /usr/local/MATLAB/R2017a/bin/glnxa64/libnativemvm.so 已加载到另一个类加载器 java.lang.UnsatisfiedLinkError: 本机库 /usr/local/MATLAB/R2017a/bin/glnxa64/libnativemvm.so 已加载另一个类加载器

我正在使用的代码是:

final String[] options = {"-noFigureWindows", "-r", "-cd"}; 
final MatlabEngine startMatlab; 
try { 
  startMatlab = MatlabEngine.startMatlab(options); 
  this.setMatLabReference(startMatlab); 
} catch (Exception ex) { 
  System.out.println("Exception" + ex.toString()); 
}

提前致谢!

4

1 回答 1

0

可能是因为您在 MPS 旁边运行 MATLAB?以下链接建议尝试使用 -nojvm -nodisplay -nosplash 选项启动 MATLAB 引擎:https ://nl.mathworks.com/matlabcentral/answers/348575-matlabpath-bin-glnxa64-libnativemvm-so-already-loaded-在另一个类加载器中

于 2017-09-06T19:56:53.703 回答