Runtime.getRuntime().exec
class Run1 { public static void main(String[] args) throws java.io.IOException { if (args.length != 1) { System.err.println("usage: java Run pathname"); return; } Process p = Runtime.getRuntime().exec(args[0]); try { System.out.println("Exit status = " + p.waitFor()); } catch (InterruptedException e) { } } }