在Matlab中使用库编译器打包的Java中运行Matlab代码时发生库错误

时间:2020-10-29 07:28:07

标签: java matlab

我已经使用“ deploytool”命令将MATLAB代码编译为Java包。在Java中使用库时,出现找不到库的错误,如下所示。

我正在使用Java 1.8.0_144(64位),MATLAB是64位,并且用于运行该库的Java也是64位。我在intellij设置的库部分中包含了JavaBuilder.jar和我的MATLAB jar。我还在资源,类路径中加载“ mclmcrrt9_4.dll”文件,也通过使用 System.loadLibrary("mclmcrrt9_4");

有关将此方法或其他任何将MATLABcode转换为java的方法的帮助,

错误:

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.UnsatisfiedLinkError: Failed to find the required library mclmcrrt9_4.dll on java.library.path.
This library is typically installed along with MATLAB or the MATLAB Runtime. Its absence may indicate an issue with that installation or 
the current path configuration, or a mismatch with the architecture of the Java interpreter on the path.
MATLAB Runtime version this component is attempting to use: 9.4.
Java interpreter architecture: win64.

0 个答案:

没有答案