Answering my own question: I used the suggestion to add matlabroot\bin\win64 to the PATH permanently using the Windows UI, instead of temporarily in Eclipse/cmd, and the code compiles now (the example problems and my own).
Using Java API gives "no nativemvm in java.library.path"
75 views (last 30 days)
I am attempting to work through the example code for the Java Matlab engine API (Note: this is calling Matlab FROM Java): https://www.mathworks.com/help/matlab/matlab_external/java-example-source-code.html
I can get to the last step, then I get the error: "java.lang.UnsatisfiedLinkError: no nativemvm in java.library.path". FYI I get this same error when trying to run my own code linked to Matlab in Eclipse.
Does anyone know how to fix this? Or know of any other information/examples/tutorials on calling the Matlab engine from Java? (This is a very new feature in 2016b so there is not much information out there)
ant on 23 Mar 2017
you need to add the matlab library to your IDE(eclipse or others) or System (if you don't use any IDEs ), see below:
that's the right solution.
J.Eric Tkaczyk on 13 Feb 2017
This also worked for me, but I had to first exit and restart my IntelliJ IDE after changing the PATH on the Windows Environment Variables
Chibing Gng on 20 Feb 2017
But in my computer I do not have the above files for 2016b.Please tell me how to fix it.
Kobe Van Reusel on 15 Mar 2017
I'm having the same problem but can't find the solution for it.
I added the path to my PATH variable and added the engine.jar to my library but stil it gives me the "no nativemvm in java.library.path" error.
Can someone explain all the steps he took to get it working? Is it important where the engine.jar file is located or can i put it in the working directory of my project?
I'm using osx with netbeans and downloaded Matlab R2017a.