Java exec executeCommand(String command)

Here you can find the source of executeCommand(String command)

Description

execute command using system.getRuntime method

License

LGPL

Exception

Parameter Description
IOException an exception
InterruptedException an exception

Declaration

private static void executeCommand(String command) throws IOException, InterruptedException 

Method Source Code

//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();
    }
}

Related

  1. executeCommand(List command)
  2. executeCommand(String cmd)
  3. executeCommand(String cmd)
  4. executeCommand(String comand)
  5. executeCommand(String command)
  6. executeCommand(String command)
  7. executeCommand(String command)
  8. executeCommand(String command)
  9. executeCommand(String command)