opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
794 stars 318 forks source link

Java bindings fails on Windows with Matlab 2024b after building from source #3958

Open nickbianco opened 4 hours ago

nickbianco commented 4 hours ago

Reported by Amir Esrafilian. After building OpenSim from source at main on Windows 11, installing the Java bindings (built using openjdk 23), and running configureOpenSim.m, trying to construct a model fails with the typical DLL load failure error:

Failed to load one or more dynamic libraries for OpenSim.
java.lang.UnsatisfiedLinkError: D:\Git_Win\EMG_COMAK\EMG-Assisted-COMAK-install\bin\osimJavaJNI.dll: A dynamic link library (DLL) initialization routine failed
Make sure OpenSim's bin directory is on your PATH.
See https://simtk-confluence.stanford.edu/display/OpenSim40/Scripting+with+Matlab
Java exception occurred:
java.lang.UnsatisfiedLinkError: org.opensim.modeling.opensimSimulationJNI.new_Model__SWIG_0()J
    at org.opensim.modeling.opensimSimulationJNI.new_Model__SWIG_0(Native Method)
    at org.opensim.modeling.Model.<init>(Model.java:840)

We confirmed that osimJavaJNI.dll exists in the bin folder, and that the bin folder is prepended to the system Path variable.

Currently investigating whether this is an issue with Matlab 2024b or something else.

nickbianco commented 4 hours ago

Installing the OpenSim 4.5 distribution via configureOpenSim.m works successfully.

aymanhab commented 3 hours ago

jdk version lust match whatever version used by matlab or they need to be compatible.