changeset 45393:de4e1efc8eec

8181335: remove packageless CompilerUtils Reviewed-by: alanb
author iignatyev
date Tue, 06 Jun 2017 19:54:08 -0700
parents fe2cb56e7fe9
children 6b54e8cd9b3d
files jdk/test/java/io/FilePermission/ReadFileOnPath.java jdk/test/java/lang/Class/forName/modules/TestDriver.java jdk/test/java/lang/Class/getResource/ResourcesTest.java jdk/test/java/lang/ClassLoader/getResource/modules/ResourcesTest.java jdk/test/java/lang/ModuleLayer/LayerAndLoadersTest.java jdk/test/java/lang/ModuleTests/access/AccessTest.java jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java jdk/test/java/lang/System/LoggerFinder/modules/Base.java jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java jdk/test/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java jdk/test/java/lang/reflect/Proxy/ProxyTest.java jdk/test/java/net/URLClassLoader/closetest/CloseTest.java jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java jdk/test/java/net/URLClassLoader/definePackage/SplitPackage.java jdk/test/java/rmi/module/ModuleTest.java jdk/test/java/security/Provider/SecurityProviderModularTest.java jdk/test/java/util/ResourceBundle/modules/cache/CacheTest.java jdk/test/java/util/ResourceBundle/modules/casesensitive/CaseInsensitiveNameClash.java jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java jdk/test/java/util/logging/modules/GetResourceBundleTest.java jdk/test/javax/security/auth/login/modules/JaasModularClientTest.java jdk/test/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java jdk/test/jdk/modules/incubator/DefaultImage.java jdk/test/jdk/modules/incubator/ImageModules.java jdk/test/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java jdk/test/jdk/modules/scenarios/container/ContainerTest.java jdk/test/jdk/modules/scenarios/overlappingpackages/OverlappingPackagesTest.java jdk/test/lib/testlibrary/CompilerUtils.java jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java jdk/test/sun/security/tools/jarsigner/AltProvider.java jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java jdk/test/tools/jlink/basic/AllModulePath.java jdk/test/tools/jlink/basic/BasicTest.java jdk/test/tools/jlink/bindservices/BindServices.java jdk/test/tools/jlink/bindservices/SuggestProviders.java jdk/test/tools/jlink/plugins/ExcludeJmodSectionPluginTest.java jdk/test/tools/jlink/plugins/LegalFilePluginTest.java jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java jdk/test/tools/jmod/JmodNegativeTest.java jdk/test/tools/jmod/JmodTest.java jdk/test/tools/launcher/modules/addexports/AddExportsTest.java jdk/test/tools/launcher/modules/addmods/AddModsTest.java jdk/test/tools/launcher/modules/addreads/AddReadsTest.java jdk/test/tools/launcher/modules/basic/BasicTest.java jdk/test/tools/launcher/modules/classpath/JavaClassPathTest.java jdk/test/tools/launcher/modules/dryrun/DryRunTest.java jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java jdk/test/tools/launcher/modules/listmods/ListModsTest.java jdk/test/tools/launcher/modules/patch/basic/PatchTest.java jdk/test/tools/launcher/modules/patch/basic/PatchTestWarningError.java jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java jdk/test/tools/launcher/modules/upgrademodulepath/UpgradeModulePathTest.java jdk/test/tools/schemagen/MultiReleaseJarTest.java jdk/test/tools/wsgen/MultiReleaseJarTest.java
diffstat 64 files changed, 221 insertions(+), 240 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/test/java/io/FilePermission/ReadFileOnPath.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/io/FilePermission/ReadFileOnPath.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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 jdk.test.lib.process.ProcessTools;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import java.nio.file.Files;
 import java.nio.file.Path;
--- a/jdk/test/java/lang/Class/forName/modules/TestDriver.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/Class/forName/modules/TestDriver.java	Tue Jun 06 19:54:08 2017 -0700
@@ -30,6 +30,7 @@
 import java.util.stream.Stream;
 
 import jdk.test.lib.util.FileUtils;
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.BeforeClass;
@@ -42,7 +43,8 @@
  * @summary Tests for Class.forName(Module,String)
  * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build TestDriver CompilerUtils jdk.testlibrary.ProcessTools TestMain TestLayer
+ * @build jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.ProcessTools
+ *        TestDriver TestMain TestLayer
  * @run testng TestDriver
  */
 
--- a/jdk/test/java/lang/Class/getResource/ResourcesTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/Class/getResource/ResourcesTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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 @@
 import java.nio.file.Paths;
 
 import static jdk.testlibrary.ProcessTools.executeTestJava;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
@@ -32,9 +33,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build ResourcesTest CompilerUtils jdk.testlibrary.*
+ * @build ResourcesTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng ResourcesTest
  * @summary Driver for basic test of Class getResource and getResourceAsStream
  */
--- a/jdk/test/java/lang/ClassLoader/getResource/modules/ResourcesTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/ClassLoader/getResource/modules/ResourcesTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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 @@
 import java.nio.file.Paths;
 
 import static jdk.testlibrary.ProcessTools.executeTestJava;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
@@ -33,9 +34,9 @@
 /**
  * @test
  * @bug 8087335
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build ResourcesTest CompilerUtils jdk.testlibrary.*
+ * @build ResourcesTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng ResourcesTest
  * @summary Driver for basic test of ClassLoader getResource and getResourceAsStream
  */
--- a/jdk/test/java/lang/ModuleLayer/LayerAndLoadersTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/ModuleLayer/LayerAndLoadersTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -23,9 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build LayerAndLoadersTest CompilerUtils ModuleUtils
+ * @build LayerAndLoadersTest jdk.test.lib.compiler.CompilerUtils ModuleUtils
  * @run testng LayerAndLoadersTest
  * @summary Tests for java.lang.ModuleLayer@defineModulesWithXXX methods
  */
@@ -48,6 +48,7 @@
 import java.util.ServiceLoader;
 import java.util.Set;
 import java.util.stream.Collectors;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
--- a/jdk/test/java/lang/ModuleTests/access/AccessTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/ModuleTests/access/AccessTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,6 +26,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.executeTestJava;
 
 import org.testng.annotations.BeforeTest;
@@ -34,9 +35,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build AccessTest CompilerUtils jdk.testlibrary.*
+ * @build AccessTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng AccessTest
  * @summary Driver for test that checks access to access to types in
  *          exported and non-exported packages.
--- a/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/StackTraceElement/WithClassLoaderName.java	Tue Jun 06 19:54:08 2017 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 6479237
  * @summary Basic test StackTraceElement with class loader names
- * @library lib /lib/testlibrary
+ * @library lib /lib/testlibrary /test/lib
  * @modules jdk.compiler
  * @build m1/* WithClassLoaderName
  * @run main/othervm m1/com.app.Main
@@ -39,6 +39,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.compiler.CompilerUtils;
+
 import com.app.Utils;
 
 public class WithClassLoaderName {
--- a/jdk/test/java/lang/System/LoggerFinder/modules/Base.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/Base.java	Tue Jun 06 19:54:08 2017 -0700
@@ -33,6 +33,7 @@
 import java.util.stream.Stream;
 
 import jdk.testlibrary.JDKToolFinder;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import static jdk.testlibrary.ProcessTools.executeCommand;
 
--- a/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -45,8 +45,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary
- * @build Base CompilerUtils jdk.testlibrary.*
+ * @library /lib/testlibrary /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run main/othervm JDKLoggerForImageTest
  */
 
--- a/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/JDKLoggerForJDKTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -45,8 +45,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
- * @build Base CompilerUtils jdk.testlibrary.*
+ * @library /lib/testlibrary /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run main/othervm JDKLoggerForJDKTest
  */
 
--- a/jdk/test/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/LoggerInImageTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -45,8 +45,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary
- * @build Base CompilerUtils jdk.testlibrary.*
+ * @library /lib/testlibrary /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run main/othervm LoggerInImageTest
  */
 
--- a/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForImageTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -45,8 +45,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary
- * @build Base CompilerUtils jdk.testlibrary.*
+ * @library /lib/testlibrary /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run main/othervm NamedLoggerForImageTest
  */
 
--- a/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/NamedLoggerForJDKTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -45,8 +45,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary
- * @build Base CompilerUtils jdk.testlibrary.*
+ * @library /lib/testlibrary /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run main/othervm NamedLoggerForJDKTest
  */
 
--- a/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -45,8 +45,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary
- * @build Base CompilerUtils jdk.testlibrary.*
+ * @library /lib/testlibrary /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run main/othervm UnnamedLoggerForImageTest
  */
 
--- a/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/System/LoggerFinder/modules/UnnamedLoggerForJDKTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -45,8 +45,8 @@
  *               patched system module, or Xbootclasspath
  *          This test does not require existence of java.logging module,
  *          but require jdk.compiler module
- * @library /lib/testlibrary
- * @build Base CompilerUtils jdk.testlibrary.*
+ * @library /lib/testlibrary /test/lib
+ * @build Base jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run main/othervm UnnamedLoggerForJDKTest
  */
 
--- a/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -23,10 +23,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules java.base/jdk.internal.module
  *          jdk.compiler
- * @build ModuleReaderTest CompilerUtils JarUtils
+ * @build ModuleReaderTest jdk.test.lib.compiler.CompilerUtils JarUtils
  * @run testng ModuleReaderTest
  * @summary Basic tests for java.lang.module.ModuleReader
  */
@@ -53,6 +53,7 @@
 import java.util.spi.ToolProvider;
 
 import jdk.internal.module.ModulePath;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
--- a/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -29,6 +29,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.executeTestJava;
 
 import org.testng.annotations.BeforeTest;
@@ -37,9 +38,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build ProxyClassAccessTest q.NP CompilerUtils jdk.testlibrary.*
+ * @build ProxyClassAccessTest q.NP jdk.testlibrary.*
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng ProxyClassAccessTest
  * @summary Driver for testing proxy class doesn't have access to
  *          types referenced by proxy interfaces
--- a/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -29,6 +29,7 @@
 import java.nio.file.Paths;
 import java.util.Arrays;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.executeTestJava;
 
 import org.testng.annotations.BeforeTest;
@@ -37,9 +38,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build ProxyTest CompilerUtils jdk.testlibrary.ProcessTools
+ * @build ProxyTest jdk.testlibrary.ProcessTools
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng ProxyLayerTest
  * @summary Test proxies to implement interfaces in a layer
  */
--- a/jdk/test/java/lang/reflect/Proxy/ProxyTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,6 +26,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.executeTestJava;
 
 import org.testng.annotations.BeforeTest;
@@ -34,9 +35,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build ProxyTest q.U CompilerUtils jdk.testlibrary.*
+ * @build ProxyTest q.U jdk.testlibrary.*
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng ProxyTest
  * @summary Driver for testing proxies accessing interfaces in named modules
  */
--- a/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -30,7 +30,7 @@
  * @library ../../../../com/sun/net/httpserver
  *          /lib/testlibrary
  *          /test/lib
- * @build FileServerHandler JarUtils CompilerUtils
+ * @build FileServerHandler JarUtils jdk.test.lib.compiler.CompilerUtils
  * @run main/othervm CloseTest
  * @summary URL-downloaded jar files can consume all available file descriptors
  */
@@ -45,6 +45,8 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.compiler.CompilerUtils;
+
 import com.sun.net.httpserver.HttpContext;
 import com.sun.net.httpserver.HttpServer;
 
--- a/jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/net/URLClassLoader/closetest/GetResourceAsStream.java	Tue Jun 06 19:54:08 2017 -0700
@@ -26,7 +26,7 @@
  * @bug 6899919
  * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build JarUtils CompilerUtils
+ * @build JarUtils jdk.test.lib.compiler.CompilerUtils
  * @run main/othervm GetResourceAsStream
  */
 
@@ -40,6 +40,7 @@
 import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
 import java.nio.file.StandardOpenOption;
+import jdk.test.lib.compiler.CompilerUtils;
 
 public class GetResourceAsStream extends Common {
     private static  final String WORK_DIR = System.getProperty("user.dir");
--- a/jdk/test/java/net/URLClassLoader/definePackage/SplitPackage.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/net/URLClassLoader/definePackage/SplitPackage.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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,8 +25,8 @@
  * @test
  * @bug 8153665
  * @summary Test two URLClassLoader define Package object of the same name
- * @library /lib/testlibrary
- * @build CompilerUtils
+ * @library /test/lib
+ * @build jdk.test.lib.compiler.CompilerUtils
  * @modules jdk.compiler
  * @run testng SplitPackage
  */
@@ -38,6 +38,7 @@
 import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
 import java.util.jar.Manifest;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
--- a/jdk/test/java/rmi/module/ModuleTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/rmi/module/ModuleTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -23,9 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @build jdk.testlibrary.ProcessTools
- *        ModuleTest CompilerUtils JarUtils
+ *        ModuleTest jdk.test.lib.compiler.CompilerUtils JarUtils
  * @run testng ModuleTest
  * @summary Basic tests for using rmi in module world
  */
@@ -36,6 +36,7 @@
 
 import java.io.File;
 import java.nio.file.Paths;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
--- a/jdk/test/java/security/Provider/SecurityProviderModularTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/security/Provider/SecurityProviderModularTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,6 +33,7 @@
 import java.lang.module.ModuleDescriptor;
 import jdk.testlibrary.ProcessTools;
 import jdk.testlibrary.OutputAnalyzer;
+import jdk.test.lib.compiler.CompilerUtils;
 import org.testng.annotations.BeforeTest;
 
 /**
@@ -40,8 +41,9 @@
  * @bug 8130360
  * @library /lib/testlibrary
  * @library /java/security/modules
+ * @library /test/lib
  * @modules java.base/jdk.internal.module
- * @build CompilerUtils JarUtils
+ * @build jdk.test.lib.compiler.CompilerUtils JarUtils
  * @summary Test custom security provider module with all possible modular
  *          condition. The test includes different combination of security
  *          client/provider modules interaction with or without service
--- a/jdk/test/java/util/ResourceBundle/modules/cache/CacheTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/util/ResourceBundle/modules/cache/CacheTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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,9 +24,9 @@
 /**
  * @test
  * @bug 8170772
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build CacheTest CompilerUtils jdk.testlibrary.*
+ * @build CacheTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng CacheTest
  */
 
@@ -37,12 +37,12 @@
 
 import jdk.testlibrary.OutputAnalyzer;
 import static jdk.testlibrary.ProcessTools.*;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
-
 @Test
 public class CacheTest {
 
--- a/jdk/test/java/util/ResourceBundle/modules/casesensitive/CaseInsensitiveNameClash.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/util/ResourceBundle/modules/casesensitive/CaseInsensitiveNameClash.java	Tue Jun 06 19:54:08 2017 -0700
@@ -24,9 +24,10 @@
 /*
  * @test
  * @bug 8177980
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build CompilerUtils jdk.testlibrary.ProcessTools CaseInsensitiveNameClash
+ * @build jdk.test.lib.compiler.CompilerUtils
+ *        jdk.testlibrary.ProcessTools CaseInsensitiveNameClash
  * @run testng CaseInsensitiveNameClash
  */
 
@@ -34,6 +35,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import jdk.testlibrary.ProcessTools;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
--- a/jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/util/ResourceBundle/modules/security/TestPermission.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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,6 +26,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.executeTestJava;
 
 import org.testng.annotations.BeforeTest;
@@ -34,9 +35,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build TestPermission CompilerUtils jdk.testlibrary.*
+ * @build TestPermission jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng TestPermission
  * @summary Driver for testing ResourceBundle::getBundle(String, Module)
  */
--- a/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -23,9 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
  * @run testng/othervm BadProvidersTest
  * @summary Basic test of ServiceLoader with bad provider and bad provider
  *          factories deployed on the module path
@@ -44,6 +44,8 @@
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import jdk.test.lib.compiler.CompilerUtils;
+
 import org.testng.annotations.Test;
 import org.testng.annotations.DataProvider;
 import static org.testng.Assert.*;
--- a/jdk/test/java/util/logging/modules/GetResourceBundleTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/java/util/logging/modules/GetResourceBundleTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -30,15 +30,17 @@
 
 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
 import static jdk.testlibrary.ProcessTools.*;
+import jdk.test.lib.compiler.CompilerUtils;
 import static org.testng.Assert.*;
 
 /**
  * @test
  * @bug 8129126 8136802 8137316 8137317 8136804 8139350
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
  *          java.logging
- * @build GetResourceBundleTest CompilerUtils jdk.testlibrary.ProcessTools
+ * @build GetResourceBundleTest jdk.testlibrary.ProcessTools
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng GetResourceBundleTest
  * @summary Tests Logger.getLogger + logger.getResourceBundle in an named/unnamed module,
  *          resources are in named and unnamed modules respectively.
--- a/jdk/test/javax/security/auth/login/modules/JaasModularClientTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/javax/security/auth/login/modules/JaasModularClientTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,14 +32,15 @@
 import java.util.ArrayList;
 import jdk.testlibrary.ProcessTools;
 import jdk.testlibrary.OutputAnalyzer;
+import jdk.test.lib.compiler.CompilerUtils;
 import org.testng.annotations.BeforeTest;
 
 /**
  * @test
  * @bug 8078813
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @library /java/security/modules
- * @build CompilerUtils JarUtils
+ * @build jdk.test.lib.compiler.CompilerUtils JarUtils
  * @summary Test custom JAAS module with all possible modular option. The test
  *          includes different combination of JAAS client/login modules
  *          interaction with or without service description.
--- a/jdk/test/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -30,6 +30,7 @@
 import java.io.IOException;
 import java.lang.module.ModuleDescriptor;
 import java.util.ArrayList;
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.testlibrary.ProcessTools;
 import jdk.testlibrary.OutputAnalyzer;
 import org.testng.annotations.BeforeTest;
@@ -37,9 +38,9 @@
 /**
  * @test
  * @bug 8151654
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @library /java/security/modules
- * @build CompilerUtils JarUtils
+ * @build jdk.test.lib.compiler.CompilerUtils JarUtils
  * @summary Test custom JAAS callback handler with all possible modular option.
  * @run testng JaasModularDefaultHandlerTest
  */
--- a/jdk/test/jdk/modules/incubator/DefaultImage.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/jdk/modules/incubator/DefaultImage.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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,14 +25,13 @@
  * @test
  * @bug 8170859
  * @summary Ensure no incubator modules are resolved by default in the image
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
  * @run testng DefaultImage
  */
 
 import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 import java.io.PrintStream;
 import java.lang.module.ModuleDescriptor;
 import java.lang.module.ModuleFinder;
@@ -42,6 +41,7 @@
 import java.nio.file.Paths;
 import java.util.function.Consumer;
 import java.util.stream.Stream;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
--- a/jdk/test/jdk/modules/incubator/ImageModules.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/jdk/modules/incubator/ImageModules.java	Tue Jun 06 19:54:08 2017 -0700
@@ -28,7 +28,7 @@
  * @library /lib/testlibrary /test/lib
  * @key intermittent
  * @modules jdk.compiler jdk.jartool jdk.jlink
- * @build CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
  * @run testng/othervm ImageModules
  */
 
@@ -45,6 +45,7 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.util.FileUtils;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/jdk/test/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/jdk/modules/scenarios/automaticmodules/RunWithAutomaticModules.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -23,9 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build RunWithAutomaticModules CompilerUtils JarUtils
+ * @build RunWithAutomaticModules jdk.test.lib.compiler.CompilerUtils JarUtils
  *        jdk.testlibrary.ProcessTools
  * @run testng RunWithAutomaticModules
  * @summary Runs tests that make use of automatic modules
@@ -35,6 +35,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.Test;
--- a/jdk/test/jdk/modules/scenarios/container/ContainerTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/jdk/modules/scenarios/container/ContainerTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -23,12 +23,12 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.jartool/sun.tools.jar
  *          jdk.compiler
  *          jdk.zipfs
  *          java.se
- * @build ContainerTest CompilerUtils jdk.testlibrary.*
+ * @build ContainerTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng ContainerTest
  * @summary Starts a simple container that uses dynamic configurations
  *          and launches two applications in the same VM
@@ -38,6 +38,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
--- a/jdk/test/jdk/modules/scenarios/overlappingpackages/OverlappingPackagesTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/jdk/modules/scenarios/overlappingpackages/OverlappingPackagesTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -23,9 +23,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build OverlappingPackagesTest CompilerUtils jdk.testlibrary.*
+ * @build OverlappingPackagesTest jdk.testlibrary.*
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng OverlappingPackagesTest
  * @summary Basic test to ensure that startup fails if two or more modules
  *          in the boot Layer have the same package
@@ -36,6 +37,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
--- a/jdk/test/lib/testlibrary/CompilerUtils.java	Wed Jun 07 10:58:58 2017 +0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2015, 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.
- */
-
-import javax.tools.JavaCompiler;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.StandardLocation;
-import javax.tools.ToolProvider;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * This class consists exclusively of static utility methods for invoking the
- * java compiler.
- */
-
-public final class CompilerUtils {
-    private CompilerUtils() { }
-
-    /**
-     * Compile all the java sources in {@code <source>/**} to
-     * {@code <destination>/**}. The destination directory will be created if
-     * it doesn't exist.
-     *
-     * All warnings/errors emitted by the compiler are output to System.out/err.
-     *
-     * @return true if the compilation is successful
-     *
-     * @throws IOException
-     *         if there is an I/O error scanning the source tree or
-     *         creating the destination directory
-     * @throws UnsupportedOperationException
-     *         if there is no system java compiler
-     */
-    public static boolean compile(Path source, Path destination, String ... options)
-        throws IOException
-    {
-        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
-        if (compiler == null) {
-            // no compiler available
-            throw new UnsupportedOperationException("Unable to get system java compiler. " +
-                "Perhaps, jdk.compiler module is not available.");
-        }
-        StandardJavaFileManager jfm = compiler.getStandardFileManager(null, null, null);
-
-        List<Path> sources
-            = Files.find(source, Integer.MAX_VALUE,
-                (file, attrs) -> (file.toString().endsWith(".java")))
-                .collect(Collectors.toList());
-
-        Files.createDirectories(destination);
-        jfm.setLocation(StandardLocation.CLASS_PATH, Collections.EMPTY_LIST);
-        jfm.setLocationFromPaths(StandardLocation.CLASS_OUTPUT,
-                                 Arrays.asList(destination));
-
-        List<String> opts = Arrays.asList(options);
-        JavaCompiler.CompilationTask task
-            = compiler.getTask(null, jfm, null, opts, null,
-                jfm.getJavaFileObjectsFromPaths(sources));
-
-        return task.call();
-    }
-}
--- a/jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/sun/net/www/protocol/jar/jarbug/TestDriver.java	Tue Jun 06 19:54:08 2017 -0700
@@ -27,7 +27,8 @@
  * @library /test/lib
  *          /lib/testlibrary
  * @modules jdk.compiler
- * @build src.test.src.TestDriver CompilerUtils JarUtils
+ * @build src.test.src.TestDriver JarUtils
+ *        jdk.test.lib.CompilerUtils
  *        jdk.test.lib.JDKToolFinder
  *        jdk.test.lib.process.*
  * @summary various resource and classloading bugs related to jar files
--- a/jdk/test/sun/security/tools/jarsigner/AltProvider.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/sun/security/tools/jarsigner/AltProvider.java	Tue Jun 06 19:54:08 2017 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4906940 8130302
  * @summary -providerPath, -providerClass, -addprovider, and -providerArg
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules java.base/jdk.internal.misc
  */
 
@@ -33,6 +33,7 @@
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.util.JarUtils;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import java.nio.file.*;
 
--- a/jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/sun/security/tools/jarsigner/multiRelease/MVJarSigningTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -26,7 +26,6 @@
  * @bug 8047305 8075618
  * @summary Tests jarsigner tool and JarSigner API work with multi-release JAR files.
  * @library /test/lib
- * @library /lib/testlibrary
  * @run main MVJarSigningTest
  */
 
@@ -59,6 +58,7 @@
 import jdk.test.lib.JDKToolFinder;
 import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.Utils;
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
--- a/jdk/test/tools/jlink/basic/AllModulePath.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jlink/basic/AllModulePath.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,11 +24,11 @@
 /*
  * @test
  * @summary jlink test of --add-module ALL-MODULE-PATH
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
  * @build jdk.testlibrary.ProcessTools
  *        jdk.testlibrary.OutputAnalyzer
- *        CompilerUtils
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng AllModulePath
  */
 
@@ -48,6 +48,7 @@
 import java.util.stream.Stream;
 import java.util.spi.ToolProvider;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.testlibrary.ProcessTools;
 
 import org.testng.annotations.BeforeClass;
--- a/jdk/test/tools/jlink/basic/BasicTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jlink/basic/BasicTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,13 +25,13 @@
  * @test
  * @summary Basic test of jlink to create jmods and images
  * @author Andrei Eremeev
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules java.base/jdk.internal.module
  *          jdk.jlink
  *          jdk.compiler
  * @build jdk.testlibrary.ProcessTools
  *        jdk.testlibrary.OutputAnalyzer
- *        JarUtils CompilerUtils
+ *        JarUtils jdk.test.lib.compiler.CompilerUtils
  * @run main BasicTest
  */
 
@@ -45,6 +45,7 @@
 import java.util.List;
 import java.util.spi.ToolProvider;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.testlibrary.OutputAnalyzer;
 import jdk.testlibrary.ProcessTools;
 
--- a/jdk/test/tools/jlink/bindservices/BindServices.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jlink/bindservices/BindServices.java	Tue Jun 06 19:54:08 2017 -0700
@@ -33,6 +33,7 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
@@ -42,9 +43,10 @@
 /**
  * @test
  * @bug 8174826
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler jdk.jlink
- * @build BindServices CompilerUtils jdk.testlibrary.ProcessTools
+ * @build BindServices jdk.testlibrary.ProcessTools
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng BindServices
  */
 
--- a/jdk/test/tools/jlink/bindservices/SuggestProviders.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jlink/bindservices/SuggestProviders.java	Tue Jun 06 19:54:08 2017 -0700
@@ -32,6 +32,7 @@
 import java.util.spi.ToolProvider;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
@@ -40,9 +41,9 @@
 /**
  * @test
  * @bug 8174826
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.charsets jdk.compiler jdk.jlink
- * @build SuggestProviders CompilerUtils
+ * @build SuggestProviders jdk.test.lib.compiler.CompilerUtils
  * @run testng SuggestProviders
  */
 
--- a/jdk/test/tools/jlink/plugins/ExcludeJmodSectionPluginTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jlink/plugins/ExcludeJmodSectionPluginTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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,10 +24,10 @@
 /*
  * @test
  * @summary Test --no-man-pages and --no-header-files
- * @library /lib/testlibrary
+ * @library /test/lib
  * @modules jdk.compiler
  *          jdk.jlink
- * @build CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
  * @run testng ExcludeJmodSectionPluginTest
  */
 
@@ -48,6 +48,7 @@
 import java.util.spi.ToolProvider;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/jdk/test/tools/jlink/plugins/LegalFilePluginTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jlink/plugins/LegalFilePluginTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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,10 +25,10 @@
  * @test
  * @bug 8169925
  * @summary Validate the license files deduplicated in the image
- * @library /lib/testlibrary
+ * @library /test/lib
  * @modules jdk.compiler
  *          jdk.jlink
- * @build CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
  * @run testng LegalFilePluginTest
  */
 
@@ -53,6 +53,7 @@
 import java.util.spi.ToolProvider;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
+import jdk.test.lib.compiler.CompilerUtils;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -29,6 +29,7 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.util.FileUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
@@ -41,7 +42,8 @@
  * @test
  * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler jdk.jlink
- * @build CompiledVersionTest CompilerUtils jdk.testlibrary.ProcessTools
+ * @build CompiledVersionTest jdk.testlibrary.ProcessTools
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng CompiledVersionTest
  */
 
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -32,6 +32,7 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.util.FileUtils;
 
 import static jdk.testlibrary.ProcessTools.*;
@@ -47,7 +48,8 @@
  * @modules jdk.compiler jdk.jlink
  * @modules java.base/jdk.internal.module
  * @modules java.base/jdk.internal.org.objectweb.asm
- * @build ModuleTargetHelper UserModuleTest CompilerUtils jdk.testlibrary.ProcessTools
+ * @build ModuleTargetHelper UserModuleTest jdk.testlibrary.ProcessTools
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng UserModuleTest
  */
 
--- a/jdk/test/tools/jmod/JmodNegativeTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jmod/JmodNegativeTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -23,10 +23,10 @@
 
 /*
  * @test
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules jdk.compiler
  *          jdk.jlink
- * @build CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
  * @run testng JmodNegativeTest
  * @summary Negative tests for jmod
  */
@@ -42,6 +42,7 @@
 import java.util.spi.ToolProvider;
 import java.util.zip.ZipOutputStream;
 import jdk.test.lib.util.FileUtils;
+import jdk.test.lib.compiler.CompilerUtils;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
--- a/jdk/test/tools/jmod/JmodTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/jmod/JmodTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -25,10 +25,10 @@
  * @test
  * @bug 8142968 8166568 8166286 8170618 8168149
  * @summary Basic test for jmod
- * @library /lib/testlibrary /test/lib
+ * @library /test/lib
  * @modules jdk.compiler
  *          jdk.jlink
- * @build CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
  * @run testng/othervm -Djava.io.tmpdir=. JmodTest
  */
 
@@ -41,6 +41,7 @@
 import java.util.regex.Pattern;
 import java.util.spi.ToolProvider;
 import java.util.stream.Stream;
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.util.FileUtils;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
--- a/jdk/test/tools/launcher/modules/addexports/AddExportsTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/addexports/AddExportsTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -23,9 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build AddExportsTest CompilerUtils jdk.testlibrary.*
+ * @build AddExportsTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng AddExportsTest
  * @summary Basic tests for java --add-exports
  */
@@ -34,6 +34,7 @@
 import java.nio.file.Paths;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.testlibrary.OutputAnalyzer;
 import static jdk.testlibrary.ProcessTools.*;
 
--- a/jdk/test/tools/launcher/modules/addmods/AddModsTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/addmods/AddModsTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -23,10 +23,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.jlink/jdk.tools.jmod
  *          jdk.compiler
- * @build AddModsTest CompilerUtils jdk.testlibrary.*
+ * @build AddModsTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng AddModsTest
  * @summary Basic test for java --add-modules
  */
@@ -35,6 +35,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
--- a/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/addreads/AddReadsTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -23,9 +23,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build AddReadsTest CompilerUtils JarUtils jdk.testlibrary.*
+ * @build AddReadsTest JarUtils jdk.testlibrary.*
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng AddReadsTest
  * @summary Basic tests for java --add-reads
  */
@@ -33,6 +34,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.testlibrary.OutputAnalyzer;
 import static jdk.testlibrary.ProcessTools.*;
 
--- a/jdk/test/tools/launcher/modules/basic/BasicTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/basic/BasicTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -23,11 +23,11 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
  *          jdk.jartool
  *          jdk.jlink
- * @build BasicTest CompilerUtils jdk.testlibrary.*
+ * @build BasicTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng BasicTest
  * @summary Basic test of starting an application as a module
  */
@@ -38,6 +38,7 @@
 import java.nio.file.Paths;
 import java.util.spi.ToolProvider;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.testlibrary.ProcessTools;
 
 import org.testng.annotations.BeforeTest;
--- a/jdk/test/tools/launcher/modules/classpath/JavaClassPathTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/classpath/JavaClassPathTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -30,6 +30,7 @@
 import java.util.Map;
 import java.util.spi.ToolProvider;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.testlibrary.OutputAnalyzer;
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.DataProvider;
@@ -42,10 +43,10 @@
  * @test
  * @bug 8168205
  * @summary Test the default class path if -Djava.class.path is set
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
  *          jdk.jartool
- * @build CompilerUtils jdk.testlibrary.*
+ * @build jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng JavaClassPathTest
  */
 
--- a/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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,10 +24,11 @@
 /**
  * @test
  * @bug 8159596
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
  *          jdk.jartool
- * @build DryRunTest CompilerUtils jdk.testlibrary.ProcessTools
+ * @build DryRunTest jdk.testlibrary.ProcessTools
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng DryRunTest
  * @summary Test java --dry-run
  */
@@ -39,13 +40,13 @@
 import java.nio.file.Paths;
 import java.util.spi.ToolProvider;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.testlibrary.ProcessTools;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
-
 @Test
 public class DryRunTest {
 
--- a/jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/limitmods/LimitModsTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -23,9 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules java.desktop java.logging jdk.compiler
- * @build LimitModsTest CompilerUtils jdk.testlibrary.*
+ * @build LimitModsTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng LimitModsTest
  * @summary Basic tests for java --limit-modules
  */
@@ -33,13 +33,13 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
-
 @Test
 public class LimitModsTest {
 
--- a/jdk/test/tools/launcher/modules/listmods/ListModsTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/listmods/ListModsTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -23,9 +23,9 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules java.se
- * @build ListModsTest CompilerUtils jdk.testlibrary.*
+ * @build ListModsTest jdk.test.lib.compiler.CompilerUtils jdk.testlibrary.*
  * @run testng ListModsTest
  * @summary Basic test for java --list-modules
  */
@@ -33,6 +33,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.testlibrary.ProcessTools;
 import jdk.testlibrary.OutputAnalyzer;
 
--- a/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/patch/basic/PatchTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -23,9 +23,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build PatchTest CompilerUtils JarUtils jdk.testlibrary.*
+ * @build PatchTest JarUtils jdk.testlibrary.*
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng PatchTest
  * @summary Basic test for --patch-module
  */
@@ -37,13 +38,13 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
-
 /**
  * Compiles and launches a test that uses --patch-module with two directories
  * of classes to override existing classes and add new classes to modules in
--- a/jdk/test/tools/launcher/modules/patch/basic/PatchTestWarningError.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/patch/basic/PatchTestWarningError.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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,9 +25,10 @@
  * @test
  * @bug 8168836
  * @summary Basic argument validation for --patch-module
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build PatchTestWarningError CompilerUtils JarUtils jdk.testlibrary.*
+ * @build PatchTestWarningError JarUtils jdk.testlibrary.*
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng PatchTestWarningError
  */
 
@@ -38,6 +39,7 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.*;
 
 import org.testng.annotations.BeforeTest;
--- a/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/patch/systemmodules/PatchSystemModules.java	Tue Jun 06 19:54:08 2017 -0700
@@ -27,7 +27,7 @@
  * @summary Patch java.base and user module with ModuleHashes attribute
  * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build CompilerUtils
+ * @build jdk.test.lib.compiler.CompilerUtils
  * @run testng PatchSystemModules
  */
 
@@ -39,6 +39,7 @@
 import java.util.List;
 import java.util.stream.Stream;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.util.FileUtils;
 import jdk.testlibrary.JDKToolFinder;
 import org.testng.annotations.BeforeTest;
--- a/jdk/test/tools/launcher/modules/upgrademodulepath/UpgradeModulePathTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/launcher/modules/upgrademodulepath/UpgradeModulePathTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -23,9 +23,10 @@
 
 /**
  * @test
- * @library /lib/testlibrary
+ * @library /lib/testlibrary /test/lib
  * @modules jdk.compiler
- * @build UpgradeModulePathTest CompilerUtils jdk.testlibrary.*
+ * @build UpgradeModulePathTest jdk.testlibrary.*
+ *        jdk.test.lib.compiler.CompilerUtils
  * @run testng UpgradeModulePathTest
  * @summary Basic test for java --upgrade-module-path
  */
@@ -34,6 +35,7 @@
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import jdk.test.lib.compiler.CompilerUtils;
 import static jdk.testlibrary.ProcessTools.executeTestJava;
 
 import org.testng.annotations.BeforeTest;
@@ -46,7 +48,6 @@
  * modue path.
  */
 
-
 @Test
 public class UpgradeModulePathTest {
 
--- a/jdk/test/tools/schemagen/MultiReleaseJarTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/schemagen/MultiReleaseJarTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -25,18 +25,18 @@
  * @test
  * @summary Test Multi-Release jar support in schemagen tool
  * @library /test/lib
- * @library /lib/testlibrary
  * @modules jdk.compiler java.xml.ws
  * @build jdk.test.lib.JDKToolFinder jdk.test.lib.JDKToolLauncher
  *        jdk.test.lib.process.OutputAnalyzer
  *        jdk.test.lib.process.ProcessTools
  *        jdk.test.lib.Utils
- *        CompilerUtils MultiReleaseJarTest
+ *        jdk.test.lib.compiler.CompilerUtils MultiReleaseJarTest
  * @run testng MultiReleaseJarTest
  */
 
 import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.Utils;
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 import org.testng.annotations.BeforeClass;
@@ -114,4 +114,5 @@
                     "--add-modules", "java.xml.ws"));
         }
     }
-}
\ No newline at end of file
+}
+
--- a/jdk/test/tools/wsgen/MultiReleaseJarTest.java	Wed Jun 07 10:58:58 2017 +0800
+++ b/jdk/test/tools/wsgen/MultiReleaseJarTest.java	Tue Jun 06 19:54:08 2017 -0700
@@ -25,18 +25,18 @@
  * @test
  * @summary Test Multi-Release jar support in wsgen tool
  * @library /test/lib
- * @library /lib/testlibrary
  * @modules jdk.compiler java.xml.ws
  * @build jdk.test.lib.JDKToolFinder jdk.test.lib.JDKToolLauncher
  *        jdk.test.lib.process.OutputAnalyzer
  *        jdk.test.lib.process.ProcessTools
  *        jdk.test.lib.Utils
- *        CompilerUtils MultiReleaseJarTest
+ *        jdk.test.lib.compiler.CompilerUtils MultiReleaseJarTest
  * @run testng MultiReleaseJarTest
  */
 
 import jdk.test.lib.JDKToolLauncher;
 import jdk.test.lib.Utils;
+import jdk.test.lib.compiler.CompilerUtils;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 import org.testng.annotations.BeforeClass;
@@ -117,4 +117,5 @@
                     "--add-modules", "java.xml.ws"));
         }
     }
-}
\ No newline at end of file
+}
+