JDK-8287917 : System.loadLibrary does not work on Big Sur if JDK is built with macOS SDK 10.15 and earlier
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:class_loading
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2022-06-07
  • Updated: 2022-09-07
  • Resolved: 2022-06-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 19 JDK 20 JDK 7 JDK 8
11.0.17-oracleFixed 17.0.5-oracleFixed 19.0.1Fixed 20 b02Fixed 7u361Fixed 8u351Fixed
Related Reports
Relates :  
Description
For backward compatility, applications built with macOS SDK 10.15 and earlier running on Big Sur will get the OS version 10.16.

For applications built with a new release of Xcode which features the macOS 11 SDK,  the major version of Big Sur will return 11.

The current implementation of System.loadLibrary supports the dynamic library cache on macOS version >= 11 which won't work if JDK is built with macOS SDK 10.15 and earlier.   As a reference, Xcode 12.1 is on SDK 10.15.6.  
Comments
Fix Request (11u) Please consider this for 11u-dev for Oracle parity. It's a clean backport. The modified test passes for me on a macOS Big Sur system, although I have been limited in terms of reproducing the failure pre-patch (details in the GitHub PR comments) Thanks
07-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk19u/pull/9 Date: 2022-08-04 01:03:12 +0000
04-08-2022

Fix request to backport to jdk19u: On macOS 11.x, system libraries are loaded from dynamic linker cache and the libraries are no longer present on the filesystem. JDK-8275703 changed the existing code to load a native library using dlopen. But the fix doesn't work if the JDK is built with macOS SDK 10.15 and earlier since it returns 10.16 as the os version. This clean backport fixes this issue.
04-08-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/1298 Date: 2022-08-02 10:12:51 +0000
02-08-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/506 Date: 2022-06-24 19:17:31 +0000
24-06-2022

Fix Request (17u) Please consider this for 17u for Oracle parity. It's a clean backport. The modified test passes for me on a macOS Big Sur system with local SDK version 10.14. Thanks
24-06-2022

Changeset: fe807217 Author: Yoshiki Sato <ysatowse@openjdk.org> Committer: Mandy Chung <mchung@openjdk.org> Date: 2022-06-15 00:12:53 +0000 URL: https://git.openjdk.org/jdk/commit/fe807217a79753f84c00432e7451c17baa6645c5
15-06-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/9077 Date: 2022-06-08 04:59:07 +0000
10-06-2022