RFR: JDK-8275703: System.loadLibrary fails on Big Sur for libraries hidden from filesystem

Alan Snyder javalists at cbfiddle.com
Wed Oct 27 18:24:13 UTC 2021



> On Oct 27, 2021, at 9:28 AM, Mandy Chung <mchung at openjdk.java.net> wrote:
> 
>>> On, macOS 11.x, system libraries are loaded from dynamic linker cache.  The libraries are no longer present on the filesystem.   `NativeLibraries::loadLibrary` checks for the file existence before calling `JVM_LoadLibrary`.   Such check no longer applies on Big Sur.   This proposes that on macOS >= 11, it will skip the file existence check and attempt to load a library for each path from java.library.path and system library path.
> 

I’m curious about this issue.

I never load system libraries directly. I load my own libraries (that support JNI entry points) and the system loader loads the necessary system frameworks that they were linked against.

What’s different in this case that motivates loading system libraries directly from Java?

  Alan



More information about the core-libs-dev mailing list