8287917: System.loadLibrary does not work on Big Sur if JDK is built with macOS SDK 10.15 and earlier

Reviewed-by: mchung
This commit is contained in:
Yoshiki Sato 2022-06-15 00:12:53 +00:00 committed by Mandy Chung
parent bbaeacb597
commit fe807217a7
2 changed files with 6 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -39,7 +39,8 @@ class ClassLoaderHelper {
try {
major = Integer.parseInt(i < 0 ? osVersion : osVersion.substring(0, i));
} catch (NumberFormatException e) {}
hasDynamicLoaderCache = major >= 11;
// SDK 10.15 and earlier always reports 10.16 instead of 11.x.x
hasDynamicLoaderCache = major >= 11 || osVersion.equals("10.16");
}
private ClassLoaderHelper() {}