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

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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