How do I resolve the error “java.lang.UnsatisfiedLinkError: nativemvm.dll already loaded in another classloader” when running a Java Engine program?
30 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2019-8-16
编辑: MathWorks Support Team
2024-5-16
I have a Java source code that calls MATLAB via MATLAB Engine API. I compiled a .WAR file from the Java source code on Windows 7. Then I deployed the .WAR file to Windows Server 2016 using JBoss EAP, and got the following error:
ERROR: java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\MATLAB\R2019a\bin\win64\nativemvm.dll already loaded in another classloader
I have MATLAB R2019a installed on both Windows 7 and Windows Sever 2016. Before deploying the .WAR file, I added "C:\Program Files\MATLAB\R2019a\bin\win64" to the PATH variable on Windows Server 2016 and added “C:\Program Files\MATLAB\R2019a\extern\engines\java\jar\engine.jar” to the “classpath” in JBoss.
How do I resolve this "nativemvm.dll" error?
采纳的回答
MathWorks Support Team
2024-5-16
编辑:MathWorks Support Team
2024-5-16
Apart from setting the PATH variable and the "classpath", you also need to make sure that your Java environment is configured properly on Windows Server. Specifically, you need to make sure that the environment variable "JAVA_HOME" is set to be the path of your JDK installation, which is the directory that contains the "bin" folder.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!