changeset 53273:bbc79e0ec9ee

8216265: [testbug] Introduce Platform.sharedLibraryPathVariableName() and adapt all tests. Summary: Also cleanup some switches over OSes and use File.pathSeparator. Reviewed-by: dholmes, mdoerr
author goetz
date Mon, 14 Jan 2019 00:00:00 +0100
parents 5328dd5d2be8
children cf80666df79a
files test/hotspot/jtreg/gtest/GTestWrapper.java test/hotspot/jtreg/runtime/signal/SigTestDriver.java test/hotspot/jtreg/vmTestbase/ExecDriver.java test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java test/jdk/com/sun/jdi/PrivateTransportTest.java test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java test/jdk/javax/net/ssl/DTLS/DTLSBufferOverflowUnderflowTest.java test/jdk/javax/net/ssl/DTLS/DTLSDataExchangeTest.java test/jdk/javax/net/ssl/DTLS/DTLSEnginesClosureTest.java test/jdk/javax/net/ssl/DTLS/DTLSHandshakeTest.java test/jdk/javax/net/ssl/DTLS/DTLSHandshakeWithReplicatedPacketsTest.java test/jdk/javax/net/ssl/DTLS/DTLSMFLNTest.java test/jdk/javax/net/ssl/DTLS/DTLSNotEnabledRC4Test.java test/jdk/javax/net/ssl/DTLS/DTLSRehandshakeTest.java test/jdk/javax/net/ssl/DTLS/DTLSRehandshakeWithDataExTest.java test/jdk/javax/net/ssl/DTLS/DTLSUnsupportedCiphersTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10BufferOverflowUnderflowTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10DataExchangeTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10EnginesClosureTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10HandshakeTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10HandshakeWithReplicatedPacketsTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10MFLNTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10NotEnabledRC4Test.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10RehandshakeTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithDataExTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10SequenceNumberTest.java test/jdk/javax/net/ssl/DTLSv10/DTLSv10UnsupportedCiphersTest.java test/jdk/javax/net/ssl/TLS/TLSDataExchangeTest.java test/jdk/javax/net/ssl/TLS/TLSEnginesClosureTest.java test/jdk/javax/net/ssl/TLS/TLSHandshakeTest.java test/jdk/javax/net/ssl/TLS/TLSMFLNTest.java test/jdk/javax/net/ssl/TLS/TLSNotEnabledRC4Test.java test/jdk/javax/net/ssl/TLS/TLSRehandshakeTest.java test/jdk/javax/net/ssl/TLS/TLSRehandshakeWithDataExTest.java test/jdk/javax/net/ssl/TLS/TLSUnsupportedCiphersTest.java test/jdk/javax/net/ssl/TLSv1/TLSDataExchangeTest.java test/jdk/javax/net/ssl/TLSv1/TLSEnginesClosureTest.java test/jdk/javax/net/ssl/TLSv1/TLSHandshakeTest.java test/jdk/javax/net/ssl/TLSv1/TLSMFLNTest.java test/jdk/javax/net/ssl/TLSv1/TLSNotEnabledRC4Test.java test/jdk/javax/net/ssl/TLSv1/TLSRehandshakeTest.java test/jdk/javax/net/ssl/TLSv1/TLSRehandshakeWithDataExTest.java test/jdk/javax/net/ssl/TLSv1/TLSUnsupportedCiphersTest.java test/jdk/javax/net/ssl/TLSv11/TLSDataExchangeTest.java test/jdk/javax/net/ssl/TLSv11/TLSEnginesClosureTest.java test/jdk/javax/net/ssl/TLSv11/TLSHandshakeTest.java test/jdk/javax/net/ssl/TLSv11/TLSMFLNTest.java test/jdk/javax/net/ssl/TLSv11/TLSNotEnabledRC4Test.java test/jdk/javax/net/ssl/TLSv11/TLSRehandshakeTest.java test/jdk/javax/net/ssl/TLSv11/TLSRehandshakeWithDataExTest.java test/jdk/javax/net/ssl/TLSv11/TLSUnsupportedCiphersTest.java test/jdk/javax/net/ssl/TLSv12/TLSEnginesClosureTest.java test/jdk/sun/security/krb5/auto/BasicProc.java test/jdk/sun/security/krb5/auto/KDC.java test/jdk/sun/security/krb5/auto/NoAddresses.java test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java test/jdk/sun/security/krb5/auto/principalProperty/PrincipalSystemPropTest.java test/jdk/tools/launcher/ExecutionEnvironment.java test/jdk/tools/launcher/JliLaunchTest.java test/jdk/tools/launcher/Test7029048.java test/jdk/vm/JniInvocationTest.java test/lib/jdk/test/lib/Platform.java
diffstat 63 files changed, 163 insertions(+), 183 deletions(-) [+]
line wrap: on
line diff
--- a/test/hotspot/jtreg/gtest/GTestWrapper.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/hotspot/jtreg/gtest/GTestWrapper.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, 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
@@ -34,6 +34,7 @@
 import java.util.stream.Stream;
 import java.util.stream.Collectors;
 
+import java.io.File;
 import java.nio.file.Paths;
 import java.nio.file.Path;
 
@@ -69,14 +70,10 @@
         // may have set LD_LIBRARY_PATH or LIBPATH to point to the jdk libjvm. In
         // that case, prepend the path with the location of the gtest library."
 
-        String ldLibraryPath = System.getenv("LD_LIBRARY_PATH");
+        String pathVar = Platform.sharedLibraryPathVariableName();
+        String ldLibraryPath = System.getenv(pathVar);
         if (ldLibraryPath != null) {
-            env.put("LD_LIBRARY_PATH", path + ":" + ldLibraryPath);
-        }
-
-        String libPath = System.getenv("LIBPATH");
-        if (libPath != null) {
-            env.put("LIBPATH", path + ":" + libPath);
+            env.put(pathVar, path + File.pathSeparator + ldLibraryPath);
         }
 
         pb.command(new String[] {
--- a/test/hotspot/jtreg/runtime/signal/SigTestDriver.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/hotspot/jtreg/runtime/signal/SigTestDriver.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2019, 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
@@ -68,8 +68,7 @@
         Path test = Paths.get(System.getProperty("test.nativepath"))
                          .resolve("sigtest")
                          .toAbsolutePath();
-        String envVar = Platform.isWindows() ? "PATH" :
-                (Platform.isOSX() ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH");
+        String envVar = Platform.sharedLibraryPathVariableName();
 
         List<String> cmd = new ArrayList<>();
         Collections.addAll(cmd,
--- a/test/hotspot/jtreg/vmTestbase/ExecDriver.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/hotspot/jtreg/vmTestbase/ExecDriver.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, 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
@@ -103,7 +103,7 @@
         if (launcher) {
             Path dir = Paths.get(Utils.TEST_JDK);
             String value;
-            String name;
+            String name = Platform.sharedLibraryPathVariableName();
             if (Platform.isWindows()) {
                 value = dir.resolve("bin")
                            .resolve(variant())
@@ -113,13 +113,11 @@
                 value += dir.resolve("bin")
                             .toAbsolutePath()
                             .toString();
-                name = "PATH";
             } else {
                 value = dir.resolve("lib")
                            .resolve(variant())
                            .toAbsolutePath()
                            .toString();
-                name = Platform.isOSX() ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH";
             }
 
             System.out.println("  with " + name + " = " +
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java	Mon Jan 14 00:00:00 2019 +0100
@@ -77,17 +77,7 @@
                 nsk.jvmti.RetransformClasses.retransform003.class.getName()
         );
 
-        String envName;
-        if (Platform.isWindows()) {
-            envName = "PATH";
-        } else if (Platform.isOSX()) {
-            envName = "DYLD_LIBRARY_PATH";
-        } else if (Platform.isAix()) {
-            envName = "LIBPATH";
-        } else {
-            envName = "LD_LIBRARY_PATH";
-        }
-
+        String envName = Platform.sharedLibraryPathVariableName();
         pb.environment()
           .merge(envName, ".", (x, y) -> y + File.pathSeparator + x);
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java	Mon Jan 14 00:00:00 2019 +0100
@@ -67,17 +67,7 @@
                 nsk.jvmti.SetNativeMethodPrefix.SetNativeMethodPrefix002.class.getName()
         );
 
-        String envName;
-        if (Platform.isWindows()) {
-            envName = "PATH";
-        } else if (Platform.isOSX()) {
-            envName = "DYLD_LIBRARY_PATH";
-        } else if (Platform.isAix()) {
-            envName = "LIBPATH";
-        } else {
-            envName = "LD_LIBRARY_PATH";
-        }
-
+        String envName = Platform.sharedLibraryPathVariableName();
         pb.environment()
           .merge(envName, ".", (x, y) -> y + File.pathSeparator + x);
 
--- a/test/jdk/com/sun/jdi/PrivateTransportTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/com/sun/jdi/PrivateTransportTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, 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
@@ -33,10 +33,12 @@
  * @run main/othervm PrivateTransportTest
  */
 
+import jdk.test.lib.Platform;
 import jdk.test.lib.Utils;
 import jdk.test.lib.process.ProcessTools;
 
 import java.io.IOException;
+import java.io.File;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -71,17 +73,8 @@
             }
             transportLib = foundLib.get();
         }
-        if (System.getProperty("os.name").startsWith("Windows")) {
-            pathSep = ";";
-            pathEnvVar = "PATH";
-        } else {
-            pathSep = ":";
-            if (System.getProperty("os.name").equals("AIX")) {
-                pathEnvVar = "LIBPATH";
-            } else {
-                pathEnvVar = "LD_LIBRARY_PATH";
-            }
-        }
+        pathEnvVar = Platform.sharedLibraryPathVariableName();
+        pathSep    = File.pathSeparator;
     }
 
     private void test() throws Throwable {
--- a/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel/InheritedChannelTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2019, 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
@@ -67,7 +67,7 @@
     private static final String ARCH = System.getProperty("os.arch");
     private static final String OS_ARCH = ARCH.equals("i386") ? "i586" : ARCH;
 
-    private static final Path LD_LIBRARY_PATH
+    private static final Path libraryPath
             = Paths.get(System.getProperty("java.library.path"));
 
     @DataProvider
@@ -98,7 +98,8 @@
 
     @Test(dataProvider = "testCases")
     public void test(String desc, List<String> opts) throws Throwable {
-        System.out.println("LD_LIBRARY_PATH=" + LD_LIBRARY_PATH);
+        String pathVar = Platform.sharedLibraryPathVariableName();
+        System.out.println(pathVar + "=" + libraryPath);
 
         List<String> args = new ArrayList<>();
         args.add(JDKToolFinder.getJDKTool("java"));
@@ -111,9 +112,8 @@
 
         Map<String, String> env = pb.environment();
         env.put("CLASSPATH", TEST_CLASSES);
-        env.put("LD_LIBRARY_PATH", LD_LIBRARY_PATH.toString());
+        env.put(pathVar, libraryPath.toString());
 
-        ProcessTools.executeCommand(pb)
-                    .shouldHaveExitValue(0);
+        ProcessTools.executeCommand(pb).shouldHaveExitValue(0);
     }
 }
--- a/test/jdk/javax/net/ssl/DTLS/DTLSBufferOverflowUnderflowTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSBufferOverflowUnderflowTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS buffer overflow and underflow status when dealing with
  *          application data.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.base/sun.security.util
--- a/test/jdk/javax/net/ssl/DTLS/DTLSDataExchangeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSDataExchangeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS application data exchange using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLS/DTLSEnginesClosureTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSEnginesClosureTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS engines closing using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLS/DTLSHandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSHandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS engines handshake using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLS/DTLSHandshakeWithReplicatedPacketsTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSHandshakeWithReplicatedPacketsTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS engines handshake using each of the supported
  *          cipher suites with replicated packets check.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLS/DTLSMFLNTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSMFLNTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing DTLS engines handshake using each of the supported
  *          cipher suites with different maximum fragment length. Testing of
  *          MFLN extension.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLS/DTLSNotEnabledRC4Test.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSNotEnabledRC4Test.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -25,7 +25,7 @@
  * @test
  * @bug 8043758
  * @summary Testing DTLS engines do not enable RC4 ciphers by default.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/DTLS/DTLSRehandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSRehandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS engines re-handshaking using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLS/DTLSRehandshakeWithDataExTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSRehandshakeWithDataExTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing DTLS engines re-handshaking using each of the supported
  *          cipher suites with application data exchange before and after
  *          re-handshake and closing of the engines.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLS/DTLSUnsupportedCiphersTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLS/DTLSUnsupportedCiphersTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing that try to enable unsupported ciphers
  *          causes IllegalArgumentException.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10BufferOverflowUnderflowTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10BufferOverflowUnderflowTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS buffer overflow and underflow status when dealing with
  *          application data.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10DataExchangeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10DataExchangeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS application data exchange using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10EnginesClosureTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10EnginesClosureTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS engines closing using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10HandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10HandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS engines handshake using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10HandshakeWithReplicatedPacketsTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10HandshakeWithReplicatedPacketsTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS engines handshake using each of the supported
  *          cipher suites with replicated packets check.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /javax/net/ssl/DTLS
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /javax/net/ssl/DTLS /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10MFLNTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10MFLNTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing DTLS engines handshake using each of the supported
  *          cipher suites with different maximum fragment length. Testing of
  *          MFLN extension.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10NotEnabledRC4Test.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10NotEnabledRC4Test.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -25,7 +25,7 @@
  * @test
  * @bug 8043758
  * @summary Testing DTLS engines do not enable RC4 ciphers by default.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10RehandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10RehandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing DTLS engines re-handshaking using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithDataExTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10RehandshakeWithDataExTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing DTLS engines re-handshaking using each of the supported
  *          cipher suites with application data exchange before and after
  *          re-handshake and closing of the engines.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10SequenceNumberTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10SequenceNumberTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing DTLS records sequence number property support in application
  *          data exchange.
  * @key randomness
- * @library /sun/security/krb5/auto /lib/testlibrary /javax/net/ssl/TLSCommon /javax/net/ssl/DTLS
+ * @library /sun/security/krb5/auto /lib/testlibrary /javax/net/ssl/TLSCommon /javax/net/ssl/DTLS /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/DTLSv10/DTLSv10UnsupportedCiphersTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/DTLSv10/DTLSv10UnsupportedCiphersTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8043758
  * @summary Testing that try to enable unsupported ciphers
  *          causes IllegalArgumentException.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/TLS/TLSDataExchangeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLS/TLSDataExchangeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS application data exchange using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLS/TLSEnginesClosureTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLS/TLSEnginesClosureTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS engines closing using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLS/TLSHandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLS/TLSHandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS engines handshake using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLS/TLSMFLNTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLS/TLSMFLNTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing TLS engines handshake using each of the supported
  *          cipher suites with different maximum fragment length. Testing of
  *          MFLN extension.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLS/TLSNotEnabledRC4Test.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLS/TLSNotEnabledRC4Test.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -25,7 +25,7 @@
  * @test
  * @bug 8085979
  * @summary Testing TLS engines do not enable RC4 ciphers by default.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/TLS/TLSRehandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLS/TLSRehandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS engines re-handshaking using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLS/TLSRehandshakeWithDataExTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLS/TLSRehandshakeWithDataExTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing TLS engines re-handshaking using each of the supported
  *          cipher suites with application data exchange before and after
  *          re-handshake and closing of the engines.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLS/TLSUnsupportedCiphersTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLS/TLSUnsupportedCiphersTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing that try to enable unsupported ciphers
  *          causes IllegalArgumentException.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/TLSv1/TLSDataExchangeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv1/TLSDataExchangeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS application data exchange using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv1/TLSEnginesClosureTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv1/TLSEnginesClosureTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS engines closing using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv1/TLSHandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv1/TLSHandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS engines handshake using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv1/TLSMFLNTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv1/TLSMFLNTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing TLS engines handshake using each of the supported
  *          cipher suites with different maximum fragment length. Testing of
  *          MFLN extension.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv1/TLSNotEnabledRC4Test.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv1/TLSNotEnabledRC4Test.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -25,7 +25,7 @@
  * @test
  * @bug 8085979
  * @summary Testing TLS engines do not enable RC4 ciphers by default.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/TLSv1/TLSRehandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv1/TLSRehandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS engines re-handshaking using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv1/TLSRehandshakeWithDataExTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv1/TLSRehandshakeWithDataExTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing TLS engines re-handshaking using each of the supported
  *          cipher suites with application data exchange before and after
  *          re-handshake and closing of the engines.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv1/TLSUnsupportedCiphersTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv1/TLSUnsupportedCiphersTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing that try to enable unsupported ciphers
  *          causes IllegalArgumentException.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/TLSv11/TLSDataExchangeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv11/TLSDataExchangeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS application data exchange using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv11/TLSEnginesClosureTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv11/TLSEnginesClosureTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS engines closing using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv11/TLSHandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv11/TLSHandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS engines handshake using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv11/TLSMFLNTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv11/TLSMFLNTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing TLS engines handshake using each of the supported
  *          cipher suites with different maximum fragment length. Testing of
  *          MFLN extension.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv11/TLSNotEnabledRC4Test.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv11/TLSNotEnabledRC4Test.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -25,7 +25,7 @@
  * @test
  * @bug 8085979
  * @summary Testing TLS engines do not enable RC4 ciphers by default.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/TLSv11/TLSRehandshakeTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv11/TLSRehandshakeTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing TLS engines re-handshaking using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv11/TLSRehandshakeWithDataExTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv11/TLSRehandshakeWithDataExTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -27,7 +27,7 @@
  * @summary Testing TLS engines re-handshaking using each of the supported
  *          cipher suites with application data exchange before and after
  *          re-handshake and closing of the engines.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/javax/net/ssl/TLSv11/TLSUnsupportedCiphersTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv11/TLSUnsupportedCiphersTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8085979
  * @summary Testing that try to enable unsupported ciphers
  *          causes IllegalArgumentException.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          java.security.jgss/sun.security.jgss.krb5
  *          java.security.jgss/sun.security.krb5:+open
--- a/test/jdk/javax/net/ssl/TLSv12/TLSEnginesClosureTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/javax/net/ssl/TLSv12/TLSEnginesClosureTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, 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
@@ -26,7 +26,7 @@
  * @bug 8207009
  * @summary Testing TLS engines closing using each of the supported
  *          cipher suites.
- * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon
+ * @library /sun/security/krb5/auto /javax/net/ssl/TLSCommon /test/lib
  * @modules java.security.jgss
  *          jdk.security.auth
  *          java.security.jgss/sun.security.jgss.krb5
--- a/test/jdk/sun/security/krb5/auto/BasicProc.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/sun/security/krb5/auto/BasicProc.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, 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
@@ -307,8 +307,7 @@
                     .prop("sun.security.nativegss.debug", "true");
             int pos = lib.lastIndexOf('/');
             if (pos > 0) {
-                p.env("LD_LIBRARY_PATH", lib.substring(0, pos));
-                p.env("DYLD_LIBRARY_PATH", lib.substring(0, pos));
+                p.env(Platform.sharedLibraryPathVariableName(), lib.substring(0, pos));
             }
         } else {
             p.perm(new java.util.PropertyPermission(
--- a/test/jdk/sun/security/krb5/auto/KDC.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/sun/security/krb5/auto/KDC.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2019, 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
@@ -21,6 +21,8 @@
  * questions.
  */
 
+import jdk.test.lib.Platform;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
@@ -1722,8 +1724,7 @@
             this.env = Map.of(
                     "KRB5_CONFIG", base + "/krb5.conf",
                     "KRB5_TRACE", "/dev/stderr",
-                    "DYLD_LIBRARY_PATH", nativePath + "/lib",
-                    "LD_LIBRARY_PATH", nativePath + "/lib");
+                    Platform.sharedLibraryPathVariableName(), nativePath + "/lib");
         }
 
         @Override
@@ -1815,8 +1816,7 @@
                     "KRB5_KDC_PROFILE", base + "/kdc.conf",
                     "KRB5_CONFIG", base + "/krb5.conf",
                     "KRB5_TRACE", "/dev/stderr",
-                    "DYLD_LIBRARY_PATH", nativePath + "/lib",
-                    "LD_LIBRARY_PATH", nativePath + "/lib");
+                    Platform.sharedLibraryPathVariableName(), nativePath + "/lib");
         }
 
         @Override
--- a/test/jdk/sun/security/krb5/auto/NoAddresses.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/sun/security/krb5/auto/NoAddresses.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, 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
@@ -24,6 +24,7 @@
 /*
  * @test
  * @bug 7032354
+ * @library /test/lib
  * @run main/othervm NoAddresses setup
  * @run main/othervm -Djdk.net.hosts.file=TestHosts NoAddresses 1
  * @run main/othervm -Djdk.net.hosts.file=TestHosts NoAddresses 2
--- a/test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/sun/security/krb5/auto/ReplayCacheTestProc.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, 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
@@ -399,8 +399,7 @@
             if (lib != null) {
                 String libDir = lib.substring(0, lib.lastIndexOf('/'));
                 p.prop("sun.security.jgss.lib", lib)
-                        .env("DYLD_LIBRARY_PATH", libDir)
-                        .env("LD_LIBRARY_PATH", libDir);
+                        .env(Platform.sharedLibraryPathVariableName(), libDir);
             }
         }
         Proc.d(label+suffix+" started");
--- a/test/jdk/sun/security/krb5/auto/principalProperty/PrincipalSystemPropTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/sun/security/krb5/auto/principalProperty/PrincipalSystemPropTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, 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
@@ -21,10 +21,10 @@
  * questions.
  */
 
-/*
+/**
  * @test
  * @bug 8075301
- * @library /sun/security/krb5/auto
+ * @library /sun/security/krb5/auto /test/lib
  * @summary New test for sun.security.krb5.principal system property.
  * The principal can set using the system property sun.security.krb5.principal.
  * This property is checked during login. If this property is not set,
--- a/test/jdk/tools/launcher/ExecutionEnvironment.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/tools/launcher/ExecutionEnvironment.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, 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
@@ -25,6 +25,7 @@
  * @test
  * @bug 4780570 4731671 6354700 6367077 6670965 4882974
  * @summary Checks for LD_LIBRARY_PATH and execution  on *nixes
+ * @library /test/lib
  * @modules jdk.compiler
  *          jdk.zipfs
  * @compile -XDignore.symbol.file ExecutionEnvironment.java
@@ -54,6 +55,9 @@
  *         launcher may add as implementation details.
  *      b. add a pldd for solaris to ensure only one libjvm.so is linked
  */
+
+import jdk.test.lib.Platform;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.util.ArrayList;
@@ -62,11 +66,7 @@
 import java.util.Map;
 
 public class ExecutionEnvironment extends TestHelper {
-    static final String LD_LIBRARY_PATH    = TestHelper.isMacOSX
-            ? "DYLD_LIBRARY_PATH"
-            : TestHelper.isAIX
-                    ? "LIBPATH"
-                    : "LD_LIBRARY_PATH";
+    static final String LD_LIBRARY_PATH    = Platform.sharedLibraryPathVariableName();
     static final String LD_LIBRARY_PATH_32 = LD_LIBRARY_PATH + "_32";
     static final String LD_LIBRARY_PATH_64 = LD_LIBRARY_PATH + "_64";
 
--- a/test/jdk/tools/launcher/JliLaunchTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/tools/launcher/JliLaunchTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, 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
@@ -35,6 +35,7 @@
 import jdk.test.lib.Platform;
 import jdk.test.lib.process.OutputAnalyzer;
 
+import java.io.File;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -47,15 +48,11 @@
         System.out.println("Launcher = " + launcher + (Files.exists(launcher) ? " (exists)" : " (not exists)"));
         ProcessBuilder pb = new ProcessBuilder(launcher.toString(), "--version");
         Map<String, String> env = pb.environment();
-        if (Platform.isWindows()) {
-            // The DLL should be in JDK/bin
-            String libdir = Paths.get(Utils.TEST_JDK).resolve("bin").toAbsolutePath().toString();
-            env.compute("PATH", (k, v) -> (v == null) ? libdir : libdir + ";" + v);
-        } else {
-            String libdir = Paths.get(Utils.TEST_JDK).resolve("lib").toAbsolutePath().toString();
-            String LD_LIBRARY_PATH = Platform.isOSX() ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH";
-            env.compute(LD_LIBRARY_PATH, (k, v) -> (v == null) ? libdir : libdir + ":" + v);
-        }
+        // On windows, the DLL should be in JDK/bin, else in JDK/lib.
+        String libdir = Paths.get(Utils.TEST_JDK).resolve(Platform.isWindows() ? "bin" : "lib")
+            .toAbsolutePath().toString();
+        String pathEnvVar = Platform.sharedLibraryPathVariableName();
+        env.compute(pathEnvVar, (k, v) -> (v == null) ? libdir : libdir + File.pathSeparator + v);
 
         OutputAnalyzer outputf = new OutputAnalyzer(pb.start());
         outputf.shouldHaveExitValue(0);
--- a/test/jdk/tools/launcher/Test7029048.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/tools/launcher/Test7029048.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, 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
@@ -21,10 +21,11 @@
  * questions.
  */
 
-/*
+/**
  * @test
  * @bug 7029048
  * @summary Checks for LD_LIBRARY_PATH on *nixes
+ * @library /test/lib
  * @compile -XDignore.symbol.file ExecutionEnvironment.java Test7029048.java
  * @run main Test7029048
  */
--- a/test/jdk/vm/JniInvocationTest.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/jdk/vm/JniInvocationTest.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2019, 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
@@ -32,6 +32,7 @@
  */
 
 import java.util.Map;
+import jdk.test.lib.Platform;
 import jdk.test.lib.Utils;
 import jdk.test.lib.process.OutputAnalyzer;
 
@@ -47,7 +48,7 @@
         ProcessBuilder pb = new ProcessBuilder(launcher.toString());
         Map<String, String> env = pb.environment();
         String libdir = Paths.get(Utils.TEST_JDK).resolve("lib").toAbsolutePath().toString();
-        env.compute("DYLD_LIBRARY_PATH", (k, v) -> (k == null) ? libdir : v + ":" + libdir);
+        env.compute(Platform.sharedLibraryPathVariableName(), (k, v) -> (k == null) ? libdir : v + ":" + libdir);
         OutputAnalyzer outputf = new OutputAnalyzer(pb.start());
         outputf.shouldHaveExitValue(0);
     }
--- a/test/lib/jdk/test/lib/Platform.java	Mon Jan 14 12:49:12 2019 +0100
+++ b/test/lib/jdk/test/lib/Platform.java	Mon Jan 14 00:00:00 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, 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
@@ -325,6 +325,21 @@
         }
     }
 
+    /*
+     * Returns name of system variable containing paths to shared native libraries.
+     */
+    public static String sharedLibraryPathVariableName() {
+        if (isWindows()) {
+            return "PATH";
+        } else if (isOSX()) {
+            return "DYLD_LIBRARY_PATH";
+        } else if (isAix()) {
+            return "LIBPATH";
+        } else {
+            return "LD_LIBRARY_PATH";
+        }
+    }
+
     public static boolean isDefaultCDSArchiveSupported() {
         return (is64bit()  &&
                 isServer() &&