3

OS is Linux Ubuntu 16.04 LTS

(The application runs absolutely fine on Windows, I did not have to configure anything after the installation of Matlab Compiler SDK)

I am writing a web application in Java which also calls some functions written in Matlab which requires install Matlab Compiler SDK, after the installation, it told me to append this /usr/local/MATLAB/MATLAB_Runtime/v901/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v901/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v901/sys/os/glnxa64: to the end of the LD_LIBRARY_PATH variable, which I did by

export LD_LIBRARY_PATH=/usr/local/MATLAB/MATLAB_Runtime/v901/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v901/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v901/sys/os/glnxa64:

But why do I keep getting this error when I try to run the web app in Netbeans?

java.lang.UnsatisfiedLinkError: Failed to find the required library libmwmclmcrrt.so.9.0.1 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.

libmwmclmcrrt.so.9.0.1 resides inside the /usr/local/MATLAB/MATLAB_Runtime/v901/runtime/glnxa64 directory

I also added -Djava.library.path to point to 3 directory entries above to see if it helps, but it does not do anything good at all.

I read several posts on here, but did not seem to solve it.

  1. JNI: Library is Found on Path, but Method is not (java.lang.UnsatisfiedLinkError)
  2. java.lang.UnsatisfiedLinkError even on setting -Djava.library.path

How do I fix this? BTW, this is a web application

13
  • Can you verify that you've set java.library.path correctly? What is the value of java.library.path property if you run java -Djava.library.path=<your paths> -XshowSettings:properties? Commented Aug 10, 2016 at 1:03
  • @vsminkov It just returns whatever I passed which is /usr/local/MATLAB/MATLAB_Runtime/v901/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v901/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v901/sys/os/glnxa64: Commented Aug 10, 2016 at 1:40
  • so... In showSettings output path doesn't split on :? What is path.separator then? Commented Aug 10, 2016 at 1:42
  • path.separator is :, it does split on : since this is Linux, java.library.path showed /usr/local/MATLAB/MATLAB_Runtime/v901/runtime/glnxa64:/usr/local/MATLAB/MATLAB_‌​Runtime/v901/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v901/sys/os/glnxa64: without the colon : Commented Aug 10, 2016 at 1:49
  • that sounds strange. is there any chance that there is mess with 64/32-bit libraries? Commented Aug 10, 2016 at 1:55

1 Answer 1

1

[ Tested on Mac OS High Sierra version 10.13.5 (17F77), should be similar for Linux ]

What I did was when I started the application server (In my case Payara). I provided the path to the javabuilder.jar like so

For Payara Full

asadmin deploy --libraries /path/to/javabuilder.jar app.war

For Payara Micro

java -jar payara-micro.jar --deploy app.war --addlibs /path/to/javabuilder.jar

Note: /path/to/javabuilder.jar is the location of javabuilder.jar within the directory MATLAB_HOME/MATLAB_Runtime/SOME_VERSION/toolbox/javabuilder/jar/javabuilder.jar, Copying this javabuilder.jar file out and reference it will fail with the same error. It must be its original path for it to work. Not sure why

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.