問題描述:html
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to find the required library mclmcrrt9_2.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.2. Java interpreter architecture: win64.
at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ProxyLibraryDir.get(MCRConfiguration.java:324) at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ProxyLibraryDir.<clinit>(MCRConfiguration.java:334) at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getProxyLibraryDir(MCRConfiguration.java:339) at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.get(MCRConfiguration.java:64) at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$MCRRoot.<clinit>(MCRConfiguration.java:76) at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getMCRRoot(MCRConfiguration.java:81) at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration$ModuleDir.<clinit>(MCRConfiguration.java:53) at com.mathworks.toolbox.javabuilder.internal.MCRConfiguration.getModuleDir(MCRConfiguration.java:58) at com.mathworks.toolbox.javabuilder.internal.MWMCR.<clinit>(MWMCR.java:1699) at nsgaii.NsgaiiMCRFactory.newInstance(NsgaiiMCRFactory.java:55) at nsgaii.NsgaiiMCRFactory.newInstance(NsgaiiMCRFactory.java:66) at nsgaii.NsgaiiOperator.<init>(NsgaiiOperator.java:167) at optimization.algorithm.nsgaii.NSGAII.main(NSGAII.java:33)
問題分析:java
未安裝matlab runtime運行環境,或運行環境版本不匹配編程
問題解決:ui
1. 安裝MCR環境(E:\MATLAB\R2017a\toolbox\compiler\deploy\win64\MCRInstaller.exe)this
配置 pathspa
C:\Program Files\MATLAB\MATLAB Runtime\v92\runtime\win64.net
配置code
MATLAB_JAVAcomponent
D:\install\java\jdk1.8.0_181\jrehtm
2. 配置java環境
JAVA_HOME
D:\install\java\jdk1.8.0_181
CLASSPATH
%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
PATH
;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin
參考連接: