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

4 visualizaciones (últimos 30 días)
cicese ut3
cicese ut3 el 1 de Jul. de 2015
Editada: cicese ut3 el 16 de Jul. de 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.

Respuesta aceptada

cicese ut3
cicese ut3 el 16 de Jul. de 2015
Editada: cicese ut3 el 16 de Jul. de 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); }

Más respuestas (1)

Harsha Medikonda
Harsha Medikonda el 9 de Jul. de 2015
Editada: Harsha Medikonda el 9 de Jul. de 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

Categorías

Más información sobre MATLAB Runtime en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by