Here you can find the source of executeCommand(String command)
Parameter | Description |
---|---|
IOException | an exception |
InterruptedException | an exception |
private static void executeCommand(String command) throws IOException, InterruptedException
//package com.java2s; //License from project: LGPL import java.io.IOException; public class Main { /**/*from w ww .jav a2 s .co m*/ * execute command using system.getRuntime method * * @throws IOException * @throws InterruptedException */ private static void executeCommand(String command) throws IOException, InterruptedException { Process p = Runtime.getRuntime().exec(command); p.waitFor(); p.destroy(); } }