I am trying to call Matlab in Java, I followed the steps given by the documentation : https://fr.mathworks.com/help/matlab/matlab_external/setup-environment.html#bvcubp5
And I tried to compile this code :
import com.mathworks.engine.*;
public class javaPassArg{
public static void main(String[] args) throws Exception{
MatlabEngine eng = MatlabEngine.startMatlab();
double[] p = {1.0, -1.0, -6.0};
double[] r = eng.feval("roots", p);
for (double e: r) {
System.out.println(e);
}
eng.close();
}
}
I added the engine.jar to Eclipse as mentioned

And I configured the environment variable of Windows

I am having a well-known error:

The nativemvm library is not found
Here is the detailed error :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no nativemvm in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.mathworks.mvm.MvmImpl.loadLibrary(MvmImpl.java:107)
at com.mathworks.mvm.MvmImpl.setJavaEngineMode(MvmImpl.java:202)
at com.mathworks.engine.MatlabEngine.<clinit>(MatlabEngine.java:69)
at javaPassArg.main(javaPassArg.java:5)
But as you can see in my screen my java.library.path is well defined, and the nativemvm.dll does really exist in the folder ! I also defined it directly in Eclipse, but it's not working either.
Does somebody have an idea?