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

8 vues (au cours des 30 derniers jours)
cicese ut3
cicese ut3 le 1 Juil 2015
Modifié(e) : cicese ut3 le 16 Juil 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.

Réponse acceptée

cicese ut3
cicese ut3 le 16 Juil 2015
Modifié(e) : cicese ut3 le 16 Juil 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); }

Plus de réponses (1)

Harsha Medikonda
Harsha Medikonda le 9 Juil 2015
Modifié(e) : Harsha Medikonda le 9 Juil 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

Catégories

En savoir plus sur MATLAB Runtime dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by