ExecDemo.java Source code

Java tutorial

Introduction

Here is the source code for ExecDemo.java

Source

class ExecDemo {
    public static void main(String args[]) {
        Runtime r = Runtime.getRuntime();
        Process p = null;

        try {
            p = r.exec("notepad");
        } catch (Exception e) {
            System.out.println("Error executing notepad.");
        }
    }
}