1
votes

I used the Matlab deployment tool to build a matlab code into a java project. I am having some problem with the Matlab-Java interface, the error while running the java code is:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to find the library mclmcrrt7_15.dll, required by MATLAB Builder JA, on java.library.path. This library is typically installed along with MATLAB or the MCR, its absence may indicate an issue with that installation or the current path configuration.The MCR version that this component is trying to use is: 7.15.

When I type "version -java" in the Matlab console, the answer is Java 1.6.0_17-b04. So,I changed my Path in the system settings to ...\Files\Java\jdk1.6.0_33\bin But since I have Java version-7 installed, It is not using version-6. In command prompt, when I checked the version of java and javac, I saw that the version of javac is 1.6 but that of java is 1.7. I also made a CLASSPATH environment variable and a JAVAHOME variable and set it to 1.6. Could you please tell me how do I change the java version being used by the system to 1.6 so that matlab can interact with it?

I think this is the problem, but I am just guessing from the error message. Please let me know if the problem is something else, and not just the incompatibility in java versions.

2
Referring to Thread Subject: MCR on Windows 7 64bit - help!I might guess you need to install the MCR that complies with the deployment tool. - zellus
@user1493972: read first part of this: stackoverflow.com/a/11056140/97160 - Amro

2 Answers

0
votes

Is the DLL mclmcrrt7_15.dll on the PATH anywhere?

For Java to be able to load a DLL, the DLL needs to be in a folder listed in the java.library.path system property. The default value for this property on Windows is the PATH environment variable.

0
votes

Just fix the same error on my machine. In my case, it is fixed by add the MATLAB path into the SYSTEM environment variables:

add in PATH

-C:\Program Files\MATLAB\R2011a\bin;
-C:\Program Files\MATLAB\R2011a\runtime\win64

Wish it is helpful.