< prev index next >

jdk/src/jdk.jlink/share/classes/jdk/tools/jmod/Main.java

Print this page

        

*** 24,33 **** --- 24,34 ---- */ package jdk.tools.jmod; import java.io.*; + import java.util.spi.ToolProvider; public class Main { public static void main(String... args) throws Exception { JmodTask t = new JmodTask(); int rc = t.run(args);
*** 35,49 **** } /** * Entry point that does <i>not</i> call System.exit. * - * @param args command line arguments * @param out output stream * @return an exit code. 0 means success, non-zero means an error occurred. */ ! public static int run(String[] args, PrintStream out) { JmodTask t = new JmodTask(); ! t.setLog(out); return t.run(args); } } --- 36,61 ---- } /** * Entry point that does <i>not</i> call System.exit. * * @param out output stream + * @param err error output stream + * @param args command line arguments * @return an exit code. 0 means success, non-zero means an error occurred. */ ! public static int run(PrintWriter out, PrintWriter err, String... args) { JmodTask t = new JmodTask(); ! t.setLog(out, err); return t.run(args); } + + public static class JmodToolProvider implements ToolProvider { + public String name() { + return "jmod"; + } + + public int run(PrintWriter out, PrintWriter err, String... args) { + return Main.run(out, err, args); + } + } }
< prev index next >