--- old/jdk/test/tools/jar/JarBackSlash.java 2016-10-12 10:04:39.000000000 -0700 +++ new/jdk/test/tools/jar/JarBackSlash.java 2016-10-12 10:04:38.000000000 -0700 @@ -28,7 +28,7 @@ /* * @test * @bug 7201156 - * @modules jdk.jartool/sun.tools.jar + * @modules jdk.jartool * @summary jar tool fails to convert file separation characters for list and extract * @author Sean Chou */ @@ -43,10 +43,13 @@ import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; - -import sun.tools.jar.Main; +import java.util.spi.ToolProvider; public class JarBackSlash { + private static final ToolProvider JAR_TOOL = ToolProvider.findFirst("jar") + .orElseThrow(() -> + new RuntimeException("jar tool not found") + ); // used construct an entry JarBackSlash/dir/file.txt private static String JARBACKSLASH = "JarBackSlash"; @@ -78,8 +81,8 @@ PipedInputStream pipedInput = new PipedInputStream(pipedOutput); PrintStream out = new PrintStream(pipedOutput); - Main jarTool = new Main(out, System.err, "jar"); - if (!jarTool.run(jarArgs)) { + int rc = JAR_TOOL.run(out, System.err, jarArgs); + if (rc != 0) { fail("Could not list jar file."); } @@ -101,8 +104,8 @@ PipedInputStream pipedInput = new PipedInputStream(pipedOutput); PrintStream out = new PrintStream(pipedOutput); - Main jarTool = new Main(out, System.err, "jar"); - if (!jarTool.run(jarArgs)) { + int rc = JAR_TOOL.run(out, System.err, jarArgs); + if (rc != 0) { fail("Could not list jar file."); }