Skip to content

Commit 12c3a23

Browse files
committed
8354898: jdk/internal/loader/NativeLibraries/Main.java fails on static JDK
Reviewed-by: jpai
1 parent 6befc18 commit 12c3a23

File tree

1 file changed

+6
-2
lines changed
  • test/jdk/jdk/internal/loader/NativeLibraries

1 file changed

+6
-2
lines changed

test/jdk/jdk/internal/loader/NativeLibraries/Main.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,15 @@
2424
/*
2525
* @test
2626
* @bug 8240975 8281335
27+
* @library /test/lib
2728
* @modules java.base/jdk.internal.loader
2829
* @build java.base/* p.Test Main
2930
* @run main/othervm/native -Xcheck:jni Main
3031
* @summary Test loading and unloading of native libraries
3132
*/
3233

3334
import jdk.internal.loader.NativeLibrariesTest;
35+
import jdk.test.lib.Platform;
3436

3537
import java.io.IOException;
3638
import java.nio.file.Files;
@@ -55,7 +57,9 @@ public static void main(String... args) throws Exception {
5557
test.unload();
5658

5759
// load zip library from JDK
58-
test.load(System.mapLibraryName("zip"), true /* succeed */);
60+
if (!Platform.isStatic()) {
61+
test.load(System.mapLibraryName("zip"), true /* succeed */);
62+
}
5963

6064
// load non-existent library
6165
test.load(System.mapLibraryName("NotExist"), false /* fail to load */);

0 commit comments

Comments
 (0)