8164689: Retrofit jar, jlink, jmod as a ToolProvider
authormchung
Wed, 12 Oct 2016 15:37:27 -0700
changeset 41521 9f45ffccd1c8
parent 41520 b73242db5c5b
child 41522 2fb1e2da56ca
8164689: Retrofit jar, jlink, jmod as a ToolProvider Reviewed-by: alanb, jjg
langtools/test/tools/javac/modules/ModulePathTest.java
--- a/langtools/test/tools/javac/modules/ModulePathTest.java	Mon Oct 10 12:36:56 2016 +0200
+++ b/langtools/test/tools/javac/modules/ModulePathTest.java	Wed Oct 12 15:37:27 2016 -0700
@@ -29,7 +29,7 @@
  *      jdk.compiler/com.sun.tools.javac.api
  *      jdk.compiler/com.sun.tools.javac.main
  *      jdk.jdeps/com.sun.tools.javap
- *      jdk.jlink/jdk.tools.jmod
+ *      jdk.jlink
  * @build toolbox.ToolBox toolbox.JarTask toolbox.JavacTask toolbox.ModuleBuilder
  *      ModuleTestBase
  * @run main ModulePathTest
@@ -39,6 +39,7 @@
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.util.spi.ToolProvider;
 
 import toolbox.JarTask;
 import toolbox.JavacTask;
@@ -420,6 +421,9 @@
                 "--class-path", dir.toString(),
                 jmod.toString()
         };
-        jdk.tools.jmod.Main.run(args, System.out);
+        ToolProvider jmodTool = ToolProvider.findFirst("jmod").orElseThrow(() ->
+                new RuntimeException("jmod tool not found")
+        );
+        jmodTool.run(System.out, System.err, args);
     }
 }