1

我部署在服務器中使用Matlab的的MCR一些圖像處理功能的Java EE項目。幾個月來我一直在嘗試這個方法,我無法完成它。問題是當它要使用MCR時,它無法找到.so庫。我得到這個錯誤:如何設置Matlab的MCR爲Ubuntu和Netbeans(UnsatisfiedLinkedError)

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.

的服務器使用:

  • Ubutuntu 64位。
  • 的Netbeans 7.4
  • Glassfish的
  • 的Java 6 SDK
  • 首先它採用MCR 7.13現在它使用MCR 8.1

事情我已經嘗試:

  • 設置環境變量LD_LIBRARY_PATH和XAPPLERSDIR與出口:

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

  • 設置環境變量LD_LIBRARY_PATH和XAPPLERSDIR與SETENV:

Command setenv not found

我已經嘗試了很多更多的東西,我不記得,他們都沒有工作,它一直顯示相同的錯誤(現在版本8.1而不是7.13)。請我感謝任何幫助。

回答

2

我在使用Linux,Java EE和Matlab時遇到了同樣的問題。我的解決辦法是:

  • 打開一個終端
  • 以root身份登錄$ su和輸入密碼
  • 編輯/ etc /環境$ gedit /etc/enviroment
  • 添加所需的變量,在我們的例子:

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"

XAPPLRESDIR="/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/X11/app-defaults"

  • 保存文件並重新啓動。
  • 以root身份啓動服務器。

您的其他解決方案(如導出)發生了什麼情況,您創建的變量與GlassFish服務器之間沒有可見性。在環境中設置變量將確保它們在任何其他程序/進程中都可見。

+1

謝謝!這對我有用! – 2014-09-06 16:55:48