Why is my Java project using Matlab Runtime giving error?
조회 수: 6 (최근 30일)
이전 댓글 표시
I have a Java project that using Matlab Runtime (R2018a (9.4)) and i add the path to pom.xml like this:
<javabuilder.path>C:\Program Files\MATLAB\MATLAB Runtime\v94\toolbox\javabuilder\jar\javabuilder.jar</javabuilder.path>
I can run this project without any error. After that, i need to hava .jar file. And then, i run this to get jar file:
mvn clean install
And i could get the .jar file without any error too. However, when i started to run this jar file i get this error:
WARN 22684 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'be3D_PD' defined in URL [jar:file:/C:/Users/user/Desktop/GitHub/Project/polys/fea/target/demo1-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/dynamics/Be3D_PD.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [dynamics.so3D_PD]: Constructor threw exception; nested exception is 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.
I don't understand why i get this error, even the project could run before jar file. Why can not find mclmcrrt9_4.dll?
댓글 수: 0
채택된 답변
Kojiro Saito
2024년 9월 7일
편집: Kojiro Saito
2024년 9월 7일
mclmcrrtX_X.dll is located in <MATLAB_Runtime_Root>\runtime\win64.
You might need to add C:\Program Files\MATLAB\MATLAB Runtime\v94\runtime\win64 to Windows Path enviroment in Command Prompt,
set PATH=%PATH%;C:\Program Files\MATLAB\MATLAB Runtime\v94\runtime\win64
before running the deployed java application.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Java Package Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!