opensim-core: Java bindings fails on Windows with Matlab 2024b after building from source

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.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (16 by maintainers)

Most upvoted comments

Thanks @RealSturdy, this is very useful information. I wonder if MATLAB has recently changed to use a system install Java environment if it exists. We can try to investigate.

We’ll give that a try!

For the record, local build works out of the box without issue on R2022a update 8