Run1.java Source code

Java tutorial

Introduction

Here is the source code for Run1.java

Source

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) {
        }
    }
}