8182404: remove jdk.testlibrary.JDKToolFinder and JDKToolLauncher
authoriignatyev
Mon, 10 Sep 2018 14:23:37 -0700
changeset 51687 1e39953aaed8
parent 51686 b8b0da4a5f49
child 51688 fd3b632801aa
8182404: remove jdk.testlibrary.JDKToolFinder and JDKToolLauncher Reviewed-by: amenkov, jcbeyler, alanb
test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java
test/jdk/java/lang/ClassLoader/getResource/GetResource.java
test/jdk/java/lang/System/LoggerFinder/modules/Base.java
test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java
test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java
test/jdk/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java
test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java
test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java
test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java
test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java
test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java
test/jdk/java/lang/management/MemoryMXBean/RunUtil.java
test/jdk/java/net/MulticastSocket/MultiDead.java
test/jdk/java/net/spi/URLStreamHandlerProvider/Basic.java
test/jdk/java/security/KeyStore/PKCS12/EntryProtectionTest.java
test/jdk/java/security/KeyStore/PKCS12/KeytoolReaderP12Test.java
test/jdk/java/security/KeyStore/PKCS12/KeytoolWriteP12Test.java
test/jdk/java/security/KeyStore/PKCS12/MetadataEmptyTest.java
test/jdk/java/security/KeyStore/PKCS12/MetadataStoreLoadTest.java
test/jdk/java/security/KeyStore/PKCS12/StoreTrustedCertAPITest.java
test/jdk/java/security/KeyStore/PKCS12/StoreTrustedCertKeytool.java
test/jdk/java/security/KeyStore/PKCS12/Utils.java
test/jdk/javax/management/mxbean/MXBeanWeirdParamTest.java
test/jdk/javax/management/security/AuthorizationTest.java
test/jdk/javax/management/security/SecurityTest.java
test/jdk/lib/testlibrary/jdk/testlibrary/JDKToolFinder.java
test/jdk/lib/testlibrary/jdk/testlibrary/JDKToolLauncher.java
test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java
test/jdk/sun/security/tools/jarsigner/Warning.java
test/jdk/sun/tools/jcmd/JcmdBase.java
test/jdk/sun/tools/jhsdb/BasicLauncherTest.java
test/jdk/sun/tools/jhsdb/HeapDumpTest.java
test/jdk/sun/tools/jhsdb/heapconfig/TmtoolTestScenario.java
test/jdk/sun/tools/jinfo/BasicJInfoTest.java
test/jdk/sun/tools/jmap/BasicJMapTest.java
test/jdk/sun/tools/jps/JpsHelper.java
test/jdk/sun/tools/jstack/BasicJStackTest.java
test/jdk/sun/tools/jstack/DeadlockDetectionTest.java
test/jdk/sun/tools/jstat/JStatInterval.java
test/jdk/sun/tools/jstat/jstatClassloadOutput1.sh
test/jdk/sun/tools/jstatd/JstatdTest.java
test/jdk/sun/tools/jstatd/TestJstatdUsage.java
test/jdk/tools/jar/compat/CLICompatibility.java
test/jdk/tools/jar/modularJar/Basic.java
test/jdk/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java
--- a/test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -40,7 +40,6 @@
 import jdk.test.lib.apps.LingeredAppWithDeadlock;
 
 import jdk.test.lib.Utils;
-import jdk.test.lib.Platform;
 import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
--- a/test/jdk/java/lang/ClassLoader/getResource/GetResource.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/ClassLoader/getResource/GetResource.java	Mon Sep 10 14:23:37 2018 -0700
@@ -24,7 +24,6 @@
 /*
  * @test
  * @bug 6760902
- * @library /lib/testlibrary
  * @library /test/lib
  * @build jdk.test.lib.process.ProcessTools
  * @run testng GetResource
@@ -45,7 +44,7 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import jdk.testlibrary.JDKToolFinder;
+import jdk.test.lib.JDKToolFinder;
 import static jdk.test.lib.process.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
--- a/test/jdk/java/lang/System/LoggerFinder/modules/Base.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/Base.java	Mon Sep 10 14:23:37 2018 -0700
@@ -32,7 +32,7 @@
 import java.util.List;
 import java.util.stream.Stream;
 
-import jdk.testlibrary.JDKToolFinder;
+import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.compiler.CompilerUtils;
 
 import static jdk.test.lib.process.ProcessTools.executeCommand;
--- a/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -32,8 +32,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary /test/lib
- * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
+ * @library /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils
  * @run main/othervm JDKLoggerForImageTest
  */
 
--- a/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -32,8 +32,8 @@
  *            2. clients are in named/unnamed module,
  *               patched system module, or Xbootclasspath
  *          This test DOES require existence of java.logging module
- * @library /lib/testlibrary /test/lib
- * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
+ * @library /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils
  * @run main/othervm JDKLoggerForJDKTest
  */
 
--- a/test/jdk/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -32,8 +32,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary /test/lib
- * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
+ * @library /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils
  * @run main/othervm LoggerInImageTest
  */
 
--- a/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -34,8 +34,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary /test/lib
- * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
+ * @library /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils
  * @run main/othervm NamedLoggerForImageTest
  */
 
--- a/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -34,8 +34,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary /test/lib
- * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
+ * @library /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils
  * @run main/othervm NamedLoggerForJDKTest
  */
 
--- a/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -34,8 +34,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary /test/lib
- * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
+ * @library /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils
  * @run main/othervm UnnamedLoggerForImageTest
  */
 
--- a/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -34,8 +34,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary /test/lib
- * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
+ * @library /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils
  * @run main/othervm UnnamedLoggerForJDKTest
  */
 
--- a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -45,8 +45,8 @@
 import java.util.concurrent.Phaser;
 import javax.management.*;
 import javax.management.openmbean.CompositeData;
+import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.process.ProcessTools;
-import jdk.testlibrary.JDKToolFinder;
 import jdk.testlibrary.Utils;
 
 import sun.hotspot.code.Compiler;
--- a/test/jdk/java/lang/management/MemoryMXBean/RunUtil.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/lang/management/MemoryMXBean/RunUtil.java	Mon Sep 10 14:23:37 2018 -0700
@@ -28,10 +28,10 @@
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Arrays;
+import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 import jdk.testlibrary.Utils;
-import jdk.testlibrary.JDKToolFinder;
 
 public class RunUtil {
 
--- a/test/jdk/java/net/MulticastSocket/MultiDead.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/net/MulticastSocket/MultiDead.java	Mon Sep 10 14:23:37 2018 -0700
@@ -26,6 +26,7 @@
  * @bug 8072466
  * @summary Deadlock when initializing MulticastSocket and DatagramSocket
  * @library /lib/testlibrary
+ * @library /test/lib
  * @build jdk.testlibrary.*
  * @run main/othervm MultiDead
  */
@@ -36,7 +37,7 @@
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.concurrent.CountDownLatch;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import jdk.testlibrary.JDKToolLauncher;
+import jdk.test.lib.JDKToolLauncher;
 import jdk.testlibrary.Utils;
 
 public class MultiDead {
--- a/test/jdk/java/net/spi/URLStreamHandlerProvider/Basic.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/net/spi/URLStreamHandlerProvider/Basic.java	Mon Sep 10 14:23:37 2018 -0700
@@ -46,7 +46,7 @@
 import javax.tools.StandardLocation;
 import javax.tools.ToolProvider;
 import jdk.test.lib.util.FileUtils;
-import jdk.testlibrary.JDKToolFinder;
+import jdk.test.lib.JDKToolFinder;
 import static java.lang.String.format;
 import static java.util.Arrays.asList;
 
@@ -55,10 +55,10 @@
  * @bug 8064924
  * @modules jdk.compiler
  * @summary Basic test for URLStreamHandlerProvider
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @build jdk.test.lib.Platform
  *        jdk.test.lib.util.FileUtils
- *        jdk.testlibrary.JDKToolFinder
+ *        jdk.test.lib.JDKToolFinder
  * @compile Basic.java Child.java
  * @run main Basic
  */
--- a/test/jdk/java/security/KeyStore/PKCS12/EntryProtectionTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/security/KeyStore/PKCS12/EntryProtectionTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -40,7 +40,7 @@
  * @summary Test for feature 'support stronger entry protection'. An entry is
  * stored to keystore with different PasswordProtection objects which are
  * specified by different PBE algorithms (use -Dseed=X to set PRNG seed)
- * @library /test/lib /lib/testlibrary ../
+ * @library /test/lib ../
  * @key randomness
  * @build jdk.test.lib.RandomFactory
  * @run main EntryProtectionTest
--- a/test/jdk/java/security/KeyStore/PKCS12/KeytoolReaderP12Test.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/security/KeyStore/PKCS12/KeytoolReaderP12Test.java	Mon Sep 10 14:23:37 2018 -0700
@@ -36,7 +36,7 @@
  * @bug 8048830
  * @summary Test for PKCS12 keystore list , export commands. Refer README for
  * keystore files information
- * @library /lib/testlibrary ../
+ * @library ../
  * @library /test/lib
  * @run main KeytoolReaderP12Test
  */
--- a/test/jdk/java/security/KeyStore/PKCS12/KeytoolWriteP12Test.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/security/KeyStore/PKCS12/KeytoolWriteP12Test.java	Mon Sep 10 14:23:37 2018 -0700
@@ -31,7 +31,7 @@
  * @test
  * @bug 8048830
  * @summary Tests for creating pkcs12 keystore with various algorithms
- * @library /lib/testlibrary ../
+ * @library ../
  * @library /test/lib
  * @run main KeytoolWriteP12Test
  */
--- a/test/jdk/java/security/KeyStore/PKCS12/MetadataEmptyTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/security/KeyStore/PKCS12/MetadataEmptyTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -39,7 +39,7 @@
  * @test
  * @bug 8048830
  * @summary Entry's attribute set should be empty
- * @library /lib/testlibrary ../
+ * @library ../
  * @library /test/lib
  * @run main MetadataEmptyTest
  */
--- a/test/jdk/java/security/KeyStore/PKCS12/MetadataStoreLoadTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/security/KeyStore/PKCS12/MetadataStoreLoadTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -43,7 +43,7 @@
  * @test
  * @bug 8048830
  * @summary Test store metadata attributes to PKCS12 keystore.
- * @library /lib/testlibrary ../
+ * @library ../
  * @library /test/lib
  * @run main MetadataStoreLoadTest
  */
--- a/test/jdk/java/security/KeyStore/PKCS12/StoreTrustedCertAPITest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/security/KeyStore/PKCS12/StoreTrustedCertAPITest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -42,7 +42,7 @@
  * @summary Test imports certificate from file to PKCS12 keystore store it as
  * trusted certificate Check import errors (must be not errors) & check keystore
  * content after import
- * @library /lib/testlibrary ../
+ * @library ../
  * @library /test/lib
  * @run main StoreTrustedCertAPITest
  */
--- a/test/jdk/java/security/KeyStore/PKCS12/StoreTrustedCertKeytool.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/security/KeyStore/PKCS12/StoreTrustedCertKeytool.java	Mon Sep 10 14:23:37 2018 -0700
@@ -38,7 +38,7 @@
  * @bug 8048830
  * @summary Tests keytool command imports certificate , list keystore, print
  * certificate and import password help.
- * @library /lib/testlibrary ../
+ * @library ../
  * @library /test/lib
  * @run main StoreTrustedCertKeytool
  */
--- a/test/jdk/java/security/KeyStore/PKCS12/Utils.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/java/security/KeyStore/PKCS12/Utils.java	Mon Sep 10 14:23:37 2018 -0700
@@ -34,7 +34,7 @@
 import java.util.List;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
-import jdk.testlibrary.JDKToolFinder;
+import jdk.test.lib.JDKToolFinder;
 import static java.lang.System.out;
 import java.util.ArrayList;
 
--- a/test/jdk/javax/management/mxbean/MXBeanWeirdParamTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/javax/management/mxbean/MXBeanWeirdParamTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -59,8 +59,8 @@
 import javax.management.openmbean.TabularDataSupport;
 import javax.management.openmbean.TabularType;
 
+import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.process.ProcessTools;
-import jdk.testlibrary.JDKToolFinder;
 
 public class MXBeanWeirdParamTest {
 
--- a/test/jdk/javax/management/security/AuthorizationTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/javax/management/security/AuthorizationTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -65,8 +65,8 @@
 import javax.management.Attribute ;
 import javax.management.ObjectName ;
 
+import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.process.ProcessTools;
-import jdk.testlibrary.JDKToolFinder;
 
 public class AuthorizationTest {
 
--- a/test/jdk/javax/management/security/SecurityTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/javax/management/security/SecurityTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -81,8 +81,8 @@
 
 import java.security.Security;
 
+import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.process.ProcessTools;
-import jdk.testlibrary.JDKToolFinder;
 
 public class SecurityTest {
 
--- a/test/jdk/lib/testlibrary/jdk/testlibrary/JDKToolFinder.java	Mon Sep 10 16:33:55 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2013, 2016, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.testlibrary;
-
-import java.io.FileNotFoundException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-/**
- * @deprecated This class is deprecated. Use the one from
- *             {@code <root>/test/lib/jdk/test/lib}
- */
-@Deprecated
-public final class JDKToolFinder {
-
-    private JDKToolFinder() {
-    }
-
-    /**
-     * Returns the full path to an executable in jdk/bin based on System
-     * property {@code test.jdk} or {@code compile.jdk} (both are set by the jtreg test suite)
-     *
-     * @return Full path to an executable in jdk/bin
-     */
-    public static String getJDKTool(String tool) {
-
-        // First try to find the executable in test.jdk
-        try {
-            return getTool(tool, "test.jdk");
-        } catch (FileNotFoundException e) {
-
-        }
-
-        // Now see if it's available in compile.jdk
-        try {
-            return getTool(tool, "compile.jdk");
-        } catch (FileNotFoundException e) {
-            throw new RuntimeException("Failed to find " + tool +
-                    ", looked in test.jdk (" + System.getProperty("test.jdk") +
-                    ") and compile.jdk (" + System.getProperty("compile.jdk") + ")");
-        }
-    }
-
-    /**
-     * Returns the full path to an executable in jdk/bin based on System
-     * property {@code compile.jdk}
-     *
-     * @return Full path to an executable in jdk/bin
-     */
-    public static String getCompileJDKTool(String tool) {
-        try {
-            return getTool(tool, "compile.jdk");
-        } catch (FileNotFoundException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Returns the full path to an executable in jdk/bin based on System
-     * property {@code test.jdk}
-     *
-     * @return Full path to an executable in jdk/bin
-     */
-    public static String getTestJDKTool(String tool) {
-        try {
-            return getTool(tool, "test.jdk");
-        } catch (FileNotFoundException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    private static String getTool(String tool, String property) throws FileNotFoundException {
-        String jdkPath = System.getProperty(property);
-
-        if (jdkPath == null) {
-            throw new RuntimeException(
-                    "System property '" + property + "' not set. This property is normally set by jtreg. "
-                    + "When running test separately, set this property using '-D" + property + "=/path/to/jdk'.");
-        }
-
-        Path toolName = Paths.get("bin", tool + (isWindows() ? ".exe" : ""));
-
-        Path jdkTool = Paths.get(jdkPath, toolName.toString());
-        if (!jdkTool.toFile().exists()) {
-            throw new FileNotFoundException("Could not find file " + jdkTool.toAbsolutePath());
-        }
-
-        return jdkTool.toAbsolutePath().toString();
-    }
-
-    private static boolean isWindows() {
-        return System.getProperty("os.name").toLowerCase().startsWith("win");
-    }
-}
--- a/test/jdk/lib/testlibrary/jdk/testlibrary/JDKToolLauncher.java	Mon Sep 10 16:33:55 2018 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2013, 2016, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.testlibrary;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A utility for constructing command lines for starting JDK tool processes.
- *
- * The JDKToolLauncher can in particular be combined with a
- * java.lang.ProcessBuilder to easily run a JDK tool. For example, the following
- * code run {@code jmap -heap} against a process with GC logging turned on for
- * the {@code jmap} process:
- *
- * <pre>
- * {@code
- * JDKToolLauncher jmap = JDKToolLauncher.create("jmap")
- *                                       .addVMArg("-Xlog:gc*=debug")
- *                                       .addToolArg("-heap")
- *                                       .addToolArg(pid);
- * ProcessBuilder pb = new ProcessBuilder(jmap.getCommand());
- * Process p = pb.start();
- * }
- * </pre>
- * @deprecated This class is deprecated. Use the one from
- *             {@code <root>/test/lib/jdk/test/lib}
- */
-@Deprecated
-public class JDKToolLauncher {
-    private final String executable;
-    private final List<String> vmArgs = new ArrayList<String>();
-    private final List<String> toolArgs = new ArrayList<String>();
-
-    private JDKToolLauncher(String tool, boolean useCompilerJDK) {
-        if (useCompilerJDK) {
-            executable = JDKToolFinder.getJDKTool(tool);
-        } else {
-            executable = JDKToolFinder.getTestJDKTool(tool);
-        }
-    }
-
-    /**
-     * Creates a new JDKToolLauncher for the specified tool. Using tools path
-     * from the compiler JDK.
-     *
-     * @param tool
-     *            The name of the tool
-     * @return A new JDKToolLauncher
-     */
-    public static JDKToolLauncher create(String tool) {
-        return new JDKToolLauncher(tool, true);
-    }
-
-    /**
-     * Creates a new JDKToolLauncher for the specified tool in the Tested JDK.
-     *
-     * @param tool
-     *            The name of the tool
-     *
-     * @return A new JDKToolLauncher
-     */
-    public static JDKToolLauncher createUsingTestJDK(String tool) {
-        return new JDKToolLauncher(tool, false);
-    }
-
-    /**
-     * Adds an argument to the JVM running the tool.
-     *
-     * The JVM arguments are passed to the underlying JVM running the tool.
-     * Arguments will automatically be prepended with "-J".
-     *
-     * Any platform specific arguments required for running the tool are
-     * automatically added.
-     *
-     *
-     * @param arg
-     *            The argument to VM running the tool
-     * @return The JDKToolLauncher instance
-     */
-    public JDKToolLauncher addVMArg(String arg) {
-        vmArgs.add(arg);
-        return this;
-    }
-
-    /**
-     * Adds an argument to the tool.
-     *
-     * @param arg
-     *            The argument to the tool
-     * @return The JDKToolLauncher instance
-     */
-    public JDKToolLauncher addToolArg(String arg) {
-        toolArgs.add(arg);
-        return this;
-    }
-
-    /**
-     * Returns the command that can be used for running the tool.
-     *
-     * @return An array whose elements are the arguments of the command.
-     */
-    public String[] getCommand() {
-        List<String> command = new ArrayList<String>();
-        command.add(executable);
-        // Add -J in front of all vmArgs
-        for (String arg : vmArgs) {
-            command.add("-J" + arg);
-        }
-        command.addAll(toolArgs);
-        return command.toArray(new String[command.size()]);
-    }
-}
--- a/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/management/jmxremote/startstop/ManagementAgentJcmd.java	Mon Sep 10 14:23:37 2018 -0700
@@ -33,7 +33,7 @@
 import jdk.internal.agent.Agent;
 import jdk.internal.agent.AgentConfigurationError;
 
-import jdk.testlibrary.JDKToolLauncher;
+import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.process.ProcessTools;
 
 /**
--- a/test/jdk/sun/security/tools/jarsigner/Warning.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/security/tools/jarsigner/Warning.java	Mon Sep 10 14:23:37 2018 -0700
@@ -21,7 +21,7 @@
  * questions.
  */
 
-import jdk.testlibrary.JDKToolLauncher;
+import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.util.JarUtils;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
--- a/test/jdk/sun/tools/jcmd/JcmdBase.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jcmd/JcmdBase.java	Mon Sep 10 14:23:37 2018 -0700
@@ -25,7 +25,7 @@
 
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
-import jdk.testlibrary.JDKToolLauncher;
+import jdk.test.lib.JDKToolLauncher;
 
 /**
  * Helper class for starting jcmd process.
--- a/test/jdk/sun/tools/jhsdb/BasicLauncherTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jhsdb/BasicLauncherTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -44,7 +44,7 @@
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.apps.LingeredApp;
 import jdk.test.lib.Platform;
-import jdk.testlibrary.JDKToolLauncher;
+import jdk.test.lib.JDKToolLauncher;
 import jdk.testlibrary.Utils;
 
 public class BasicLauncherTest {
--- a/test/jdk/sun/tools/jhsdb/HeapDumpTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jhsdb/HeapDumpTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -39,12 +39,12 @@
 import java.util.List;
 import java.util.Arrays;
 
+import jdk.test.lib.Platform;
+import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.apps.LingeredApp;
-import jdk.test.lib.Platform;
 import jdk.test.lib.hprof.parser.HprofReader;
-import jdk.testlibrary.JDKToolLauncher;
 
 public class HeapDumpTest {
 
--- a/test/jdk/sun/tools/jhsdb/heapconfig/TmtoolTestScenario.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jhsdb/heapconfig/TmtoolTestScenario.java	Mon Sep 10 14:23:37 2018 -0700
@@ -33,7 +33,7 @@
 import java.util.logging.Logger;
 
 import jdk.test.lib.apps.LingeredApp;
-import jdk.testlibrary.JDKToolLauncher;
+import jdk.test.lib.JDKToolLauncher;
 import jdk.testlibrary.Utils;
 
 public class TmtoolTestScenario {
--- a/test/jdk/sun/tools/jinfo/BasicJInfoTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jinfo/BasicJInfoTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -23,16 +23,14 @@
 
 import java.util.Arrays;
 
+import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
-import jdk.testlibrary.JDKToolLauncher;
 
 /*
  * @test
  * @summary Unit test for jinfo utility
- * @library /lib/testlibrary
  * @library /test/lib
- * @build jdk.testlibrary.*
  * @run main BasicJInfoTest
  */
 public class BasicJInfoTest {
--- a/test/jdk/sun/tools/jmap/BasicJMapTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jmap/BasicJMapTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -27,10 +27,10 @@
 import java.io.File;
 import java.util.Arrays;
 
+import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.hprof.HprofParser;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
-import jdk.testlibrary.JDKToolLauncher;
 
 /*
  * @test
--- a/test/jdk/sun/tools/jps/JpsHelper.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jps/JpsHelper.java	Mon Sep 10 14:23:37 2018 -0700
@@ -35,10 +35,10 @@
 import java.util.Arrays;
 import java.util.List;
 
+import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 import jdk.testlibrary.Asserts;
-import jdk.testlibrary.JDKToolLauncher;
 import jdk.testlibrary.Utils;
 
 /**
--- a/test/jdk/sun/tools/jstack/BasicJStackTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jstack/BasicJStackTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -25,14 +25,12 @@
 
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
-import jdk.testlibrary.JDKToolLauncher;
+import jdk.test.lib.JDKToolLauncher;
 
 /*
  * @test
  * @summary Unit test for jstack utility
- * @library /lib/testlibrary
  * @library /test/lib
- * @build jdk.testlibrary.*
  * @run main BasicJStackTest
  */
 public class BasicJStackTest {
--- a/test/jdk/sun/tools/jstack/DeadlockDetectionTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jstack/DeadlockDetectionTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -32,7 +32,7 @@
 import jdk.test.lib.process.ProcessTools;
 
 import jdk.testlibrary.Utils;
-import jdk.testlibrary.JDKToolLauncher;
+import jdk.test.lib.JDKToolLauncher;
 
 /**
  * @test
--- a/test/jdk/sun/tools/jstat/JStatInterval.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jstat/JStatInterval.java	Mon Sep 10 14:23:37 2018 -0700
@@ -24,18 +24,17 @@
 /**
  * @test
  * @bug 8035668
- * @library /lib/testlibrary
  * @library /test/lib
  * @summary Test checks case when target application finishes execution and jstat didn't complete work.
             jstat is started with interval = 100 (jstat -compiler 100) and monitored application finishes
             after 500ms. This shouldn't cause crash or hang in target application or in jstat.
  * @modules java.management
- * @build jdk.testlibrary.* JStatInterval
+ * @build JStatInterval
  * @run main JStatInterval
  */
 
+import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.process.ProcessTools;
-import jdk.testlibrary.JDKToolLauncher;
 
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
--- a/test/jdk/sun/tools/jstat/jstatClassloadOutput1.sh	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jstat/jstatClassloadOutput1.sh	Mon Sep 10 14:23:37 2018 -0700
@@ -22,7 +22,7 @@
 #
 
 # @test
-# @bug 6959965 
+# @bug 6959965
 # @run shell jstatClassloadOutput1.sh
 # @summary Test that output of 'jstat -classload 0' has expected line counts
 
--- a/test/jdk/sun/tools/jstatd/JstatdTest.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jstatd/JstatdTest.java	Mon Sep 10 14:23:37 2018 -0700
@@ -30,8 +30,8 @@
 
 import jdk.test.lib.thread.ProcessThread;
 import static jdk.testlibrary.Asserts.*;
-import jdk.testlibrary.JDKToolLauncher;
 import jdk.testlibrary.Utils;
+import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/test/jdk/sun/tools/jstatd/TestJstatdUsage.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/sun/tools/jstatd/TestJstatdUsage.java	Mon Sep 10 14:23:37 2018 -0700
@@ -21,17 +21,15 @@
  * questions.
  */
 
-import jdk.testlibrary.JDKToolLauncher;
+import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
 /*
  * @test
  * @bug 4990825
- * @library /lib/testlibrary
  * @library /test/lib
  * @modules java.management
- * @build jdk.testlibrary.*
  * @run main TestJstatdUsage
  */
 public class TestJstatdUsage {
--- a/test/jdk/tools/jar/compat/CLICompatibility.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/tools/jar/compat/CLICompatibility.java	Mon Sep 10 14:23:37 2018 -0700
@@ -36,7 +36,7 @@
 import java.util.stream.Stream;
 
 import jdk.test.lib.util.FileUtils;
-import jdk.testlibrary.JDKToolFinder;
+import jdk.test.lib.JDKToolFinder;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 
@@ -52,7 +52,7 @@
  * @library /lib/testlibrary /test/lib
  * @build jdk.test.lib.Platform
  *        jdk.test.lib.util.FileUtils
- *        jdk.testlibrary.JDKToolFinder
+ *        jdk.test.lib.JDKToolFinder
  * @run testng CLICompatibility
  * @summary Basic test for compatibility of CLI options
  */
--- a/test/jdk/tools/jar/modularJar/Basic.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/tools/jar/modularJar/Basic.java	Mon Sep 10 14:23:37 2018 -0700
@@ -36,7 +36,7 @@
 import java.util.stream.Stream;
 
 import jdk.test.lib.util.FileUtils;
-import jdk.testlibrary.JDKToolFinder;
+import jdk.test.lib.JDKToolFinder;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
@@ -47,12 +47,12 @@
 /*
  * @test
  * @bug 8167328 8171830 8165640 8174248 8176772 8196748 8191533
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules jdk.compiler
  *          jdk.jartool
  * @build jdk.test.lib.Platform
  *        jdk.test.lib.util.FileUtils
- *        jdk.testlibrary.JDKToolFinder
+ *        jdk.test.lib.JDKToolFinder
  * @compile Basic.java
  * @run testng Basic
  * @summary Tests for plain Modular jars & Multi-Release Modular jars
--- a/test/jdk/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java	Mon Sep 10 16:33:55 2018 -0400
+++ b/test/jdk/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java	Mon Sep 10 14:23:37 2018 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 8157068 8177844
  * @summary Patch java.base and user module with ModuleHashes attribute
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules jdk.compiler
  * @build jdk.test.lib.compiler.CompilerUtils
  *        jdk.test.lib.util.FileUtils
@@ -43,7 +43,7 @@
 
 import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.util.FileUtils;
-import jdk.testlibrary.JDKToolFinder;
+import jdk.test.lib.JDKToolFinder;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;