/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package pstart; import java.io.IOException; /** * * @author tomuell */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { if (args.length ==0) { System.out.println("missing subcommand."); return; } String cmd = args[0]; if (cmd.equals("start")) { System.out.println("Starting background process..."); System.in.close(); System.err.close(); System.out.close(); Runtime.getRuntime().exec("java -jar \\ws\\PStart\\dist\\PStart.jar background"); return; } if (cmd.equals("background")) { doBackground(); return; } System.out.println("unrecognized command: " + cmd); } public static void doBackground() throws IOException { while (true) { try { Thread.sleep(10 * 1000); } catch (InterruptedException ie) {} } } }