static List<String> repack( File inFile, File outFile, boolean disableNative, String... extraOpts) { List<String> cmdList = new ArrayList<>(); cmdList.clear(); cmdList.add(Utils.getJavaCmd()); cmdList.add("-ea"); cmdList.add("-esa"); if (disableNative) { cmdList.add("-Dcom.sun.java.util.jar.pack.disable.native=true"); } cmdList.add("com.sun.java.util.jar.pack.Driver"); cmdList.add("--repack"); if (extraOpts != null) { for (String opt : extraOpts) { cmdList.add(opt); } } cmdList.add(outFile.getName()); cmdList.add(inFile.getName()); return Utils.runExec(cmdList); }
static void doCompareVerify(File reference, File specimen) throws IOException { init(); List<String> cmds = new ArrayList<String>(); cmds.add(getJavaCmd()); cmds.add("-cp"); cmds.add( Utils.locateJar("tools.jar") + System.getProperty("path.separator") + VerifierJar.getName()); cmds.add("sun.tools.pack.verify.Main"); cmds.add(reference.getAbsolutePath()); cmds.add(specimen.getAbsolutePath()); cmds.add("-O"); runExec(cmds); }