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

时间:2017-09-05 15:44:02

标签: matlab mps

我试图从Jetbrains MPS调用MATLAB函数。但是,我收到了这个错误:

  

Native Library /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()); 
}

提前致谢!

1 个答案:

答案 0 :(得分:0)

也许是因为你在MPS旁边运行MATLAB?以下链接建议尝试使用-nojvm -nodisplay -nosplash选项启动MATLAB引擎:https://nl.mathworks.com/matlabcentral/answers/348575-matlabpath-bin-glnxa64-libnativemvm-so-already-loaded-in-another-classloader