changeset 3701:de2329607ab5

8164689: Retrofit jar, jlink, jmod as a ToolProvider Reviewed-by: alanb, jjg
author mchung
date Wed, 12 Oct 2016 15:37:27 -0700
parents 3e9fcb2a7a52
children 2fd02a123cf0
files test/tools/javac/modules/ModulePathTest.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/javac/modules/ModulePathTest.java	Mon Oct 10 12:36:56 2016 +0200
+++ b/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);
     }
 }