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

3 Ansichten (letzte 30 Tage)
cicese ut3
cicese ut3 am 1 Jul. 2015
Bearbeitet: cicese ut3 am 16 Jul. 2015
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.

Akzeptierte Antwort

cicese ut3
cicese ut3 am 16 Jul. 2015
Bearbeitet: cicese ut3 am 16 Jul. 2015
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); }

Weitere Antworten (1)

Harsha Medikonda
Harsha Medikonda am 9 Jul. 2015
Bearbeitet: Harsha Medikonda am 9 Jul. 2015
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

Kategorien

Mehr zu MATLAB Runtime finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by