protected void kill ( String pid ) throws IOException , InterruptedException { String os = System . getProperty ( "os.name" ) ; String command = ( os . startsWith ( "Windows" ) ) ? "taskkill /F /PID " + pid : "kill " + pid ; Runtime . getRuntime ( ) . exec ( command ) . waitFor ( ) ; }
copied from Play! Framework s play . utils . Utils Java class