Hi,
I'm doing Java 22 experiments with open source package "wgpu-macos-aarch64-release" on my Mac M3.
This library contains a .dylib file and a .a file.
In Java you can load native dynamic libraries using JNI. I used that in the past. Now in MacOS 15 this stopped working.
Currently, I compile my Java file and run the binary file on the command line, including the library directory. The application would load the library from that directory. This should normally works but the library is not loaded.
After some investigation it seems the .dylib is rejected by MacOS.
Calling
spctl --assess --verbose=4 libwgpu_native.dylib
gives
libwgpu_native.dylib: rejected
without any extra reason message.
Using
sudo xattr -rd com.apple.quarantine libwgpu_native.dylib
doesn't solve the problem.
I also can't "accept" it in "Privacy & Security" because it's run as a command line call.
I know that code signing should be done for "complete" applications. But these are just experiments and working with single dynamic libraries.
How should this be done, to be able to load those libraries in a Java command line program? Or in general, how can you load an unsigned dylib in an application (apart from using Java as a tool).
Kr,
J