--- old/test/tools/jar/ChangeDir.java 2016-10-11 11:00:29.000000000 -0700 +++ new/test/tools/jar/ChangeDir.java 2016-10-11 11:00:29.000000000 -0700 @@ -24,7 +24,7 @@ /** * @test * @bug 4806786 8023113 - * @modules jdk.jartool/sun.tools.jar + * @modules jdk.jartool * @summary jar -C doesn't ignore multiple // in path */ @@ -32,10 +32,13 @@ import java.nio.file.*; import java.util.*; import java.util.jar.*; +import java.util.spi.ToolProvider; import java.util.stream.Stream; -import sun.tools.jar.Main; public class ChangeDir { + private static final ToolProvider JAR_TOOL = + ToolProvider.findFirst("jar").get(); + private final static String jarName = "test.jar"; private final static String fileName = "hello.txt"; @@ -88,8 +91,9 @@ argList.add(topDir.toString() + sep + "a" + sep + sep + "b"); // Note double 'sep' is intentional argList.add(fileName); - Main jarTool = new Main(System.out, System.err, "jar"); - if (!jarTool.run(argList.toArray(new String[argList.size()]))) { + int rc = JAR_TOOL.run(System.out, System.err, + argList.toArray(new String[argList.size()])); + if (rc != 0) { fail("Could not create jar file."); }