I am deploying a Java EE project in a server that uses the MCR of Matlab for some image processing functions. I've been trying this for months I can't make it work. The problem is when it is going to uses the MCR it cannot find the .so libraries. I got this error:
javax.servlet.ServletException: Failed to find the library libmwmclmcrrt.so.7.13, 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 r the current path configuration. The MCR version that this component is trying to use is 7.13.
ROOT CAUSE:
java.lang.UnsatisfiedLinkError: Failed to find the library libmwmclmcrrt.so.7.13, 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.13.
The servers uses:
- Ubutuntu 64 bits.
- Netbeans 7.4
- Glassfish
- java 6 sdk
- first it uses MCR 7.13 now it uses MCR 8.1
Things I've already tried:
- Setting the environment variables LD_LIBRARY_PATH and XAPPLERSDIR with export:
export LD_LIBRARY_PATH=/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/bin/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/server:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64:$LD_LIBRARY_PATH
export XAPPLRESDIR=/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/X11/app-defaults
- Setting the environment variables LD_LIBRARY_PATH and XAPPLERSDIR with setenv:
Command setenv not found
- Edit ld.so.conf file and run ldconfig
- Add -Djava.library.path=my/path/to/so in glassfish
- Add -Djava.library.path=my/path/to/so in Netbeans like says here: giving 'java.library.path' in netbeans for .dll/.so files
- I tried to set environment variables in Netbeans like said in this post: How to set Environment Variable in Netbeans? But I can't find "Actions"
- I tried to set environment variables in Netbeans like said in this post: https://askubuntu.com/questions/267071/ld-library-path-specification But I can't find "Environment"
I've tried lots of more things that I can't remember and none of them works, it keeps showing the same error (now for version 8.1 instead of 7.13). Please I would I appreciate any help.