Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.IOException;

public class Main {
    private static int exec(String cmd) {
        try {
            Runtime runtime = Runtime.getRuntime();
            Process p = runtime.exec(cmd);
            return p.waitFor();
        } catch (IOException e) {
            e.printStackTrace();
            return -1;
        } catch (InterruptedException e) {
            e.printStackTrace();
            return -1;
        }
    }
}