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!