I have compiled my function MATLAB file(s) into one or more Java classes contained in a JAR-file (.jar) component. I am using the classes in my external Java driver application, and developing the application outside of MATLAB, in a text editor or IDE.
When executing my driver application, I get the following error when initializing an instance of a MATLAB-compiled class in my code. This is despite the fact that I have specified all the necessary file paths in my -CLASSPATH argument to the Java compiler (javac.exe).
java.lang.Exception: Failed to find the runtime libraries, required by
MATLAB Builder JA, on system path
at com.mathworks.toolbox.javabuilder.internal.MWMCR.getMLorMCRRuntimeLibDir(MWMCR.java:1532)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.<clinit>(MWMCR.java:1434)
at magicsquare.magicsquareMCRFactory.<clinit>(magicsquareMCRFactory.java:101)
at magicsquare.magic.main(magic.java:99)
java.lang.UnsatisfiedLinkError: mclIsStandaloneMode
at com.mathworks.toolbox.javabuilder.internal.MWMCR.mclIsStandaloneMode(Native Method)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.getNativeMCR(MWMCR.java:746)
at magicsquare.magicsquareMCRFactory.createComponentData(magicsquareMCRFactory.java:110)
at magicsquare.magicsquareMCRFactory.<clinit>(magicsquareMCRFactory.java:101)
at magicsquare.magic.main(magic.java:99)
Best Answer