mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
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:
parent
bbaeacb597
commit
fe807217a7
2 changed files with 6 additions and 3 deletions
|
@ -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() {}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 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
|
||||
|
@ -42,6 +42,8 @@ import java.nio.file.Paths;
|
|||
|
||||
public class LibraryFromCache {
|
||||
public static void main(String[] args) throws IOException {
|
||||
System.out.println("os.version = " + System.getProperty("os.version"));
|
||||
|
||||
String libname = args[0];
|
||||
if (!systemHasLibrary(libname)) {
|
||||
System.out.println("Test skipped. Library " + libname + " not found");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue