필터 지우기
필터 지우기

Why I can't run a .jar file compiled in Matlab, in Netbeans?

조회 수: 3 (최근 30일)
cicese ut3
cicese ut3 2015년 7월 1일
편집: cicese ut3 2015년 7월 16일
Hi, when I try to run a .jar compiled in matlab using de library compiler tool, I have the next error:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Failed to find the required library libmwmclmcrrt.so.8.4 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: 8.4.
I don't know what to do for resolve this problem. I set the LD_LIBRARY_PATH variable, but nothing changed. I'm using Matlab R2014b in a OS Xubuntu.

채택된 답변

cicese ut3
cicese ut3 2015년 7월 16일
편집: cicese ut3 2015년 7월 16일
My solution was use the ProcessBuilder java class. With this class I was able to run the jar file generated, in the same way how it is executed from console.
Example:
ProcessBuilder pb = new ProcessBuilder("java", "-cp", "CLASSPATH","Class1", "Values");
//This two lines allow us to set the LD_LIBRARY_PATH
Map<String, String> env = pb.environment();
env.put("LD_LIBRARY_PATH", LD_LIBRARY_PATH);
try { Process p = pb.start(); } catch (IOException ex) { ex.printStackTrace(System.out); }

추가 답변 (1개)

Harsha Medikonda
Harsha Medikonda 2015년 7월 9일
편집: Harsha Medikonda 2015년 7월 9일
Please include the following directories in LD_LIBRARY_PATH
mcr_root/version/runtime/glnxa64
mcr_root/version/bin/glnxa64
mcr_root/version/sys/os/glnxa64
mcr_root/version/sys/java/jre/glnxa64/jre/lib/amd64/native_threads
mcr_root/version/sys/java/jre/glnxa64/jre/lib/amd64/server
mcr_root/version/sys/java/jre/glnxa64/jre/lib/amd64
where 'mcr_root' is the installation path of the MATLAB COMPILER RUNTIME and set the XAPPLRESDIR environment variable to the following directory
mcr_root/version/X11/app-defaults

카테고리

Help CenterFile Exchange에서 MATLAB Runtime에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by