Runtime.getRuntime().exec : Runtime « Development Class « Java
- Java
- Development Class
- Runtime
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) {
}
}
}
Related examples in the same category