Here you can find the source of closeProcess(Process process)
private static void closeProcess(Process process)
//package com.java2s; //License from project: LGPL import java.io.IOException; public class Main { private static void closeProcess(Process process) { try {//from w w w . j av a 2 s . com process.getInputStream().close(); process.getOutputStream().close(); process.getErrorStream().close(); } catch (IOException e) { } process.destroy(); try { process.waitFor(); } catch (InterruptedException e) { } process = null; } }