Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
8287917: System.loadLibrary does not work on Big Sur if JDK is built …
…with macOS SDK 10.15 and earlier

Reviewed-by: coffeys
Backport-of: fe80721
  • Loading branch information
Yoshiki Sato authored and coffeys committed Aug 4, 2022
1 parent 4d1e9b3 commit 2ff243c
Show file tree
Hide file tree
Showing 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
Expand Down Expand Up @@ -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() {}
Expand Down
@@ -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
Expand Down Expand Up @@ -42,6 +42,8 @@

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");
Expand Down

1 comment on commit 2ff243c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.