title: How to kill the running port number using java
body: <p>I'm trying to kill the <code>running port(8080)</code> by using the below <code>java</code> code. But, it seems the code is not working.</p>
  
  <pre><code>Process process = Runtime.getRuntime().exec("netstat -aon | find 8080");
  InputStream ips = process.getInputStream();
  InputStreamReader isr = new InputStreamReader(ips);
  BufferedReader br = new BufferedReader(isr);
  String value = null;
  while ((value = br.readLine()) != null) {
      System.out.println(value);
  }
  </code></pre>
  
  <p>I didn't find that anything got printed into output console. And not sure how to proceed further.</p>
  
  <p>I want this code to work on <code>windows</code> and <code>linux</code> box. Is there any general solution to make this code work on both OS and how to kill the port using <code>JAVA</code> ?
  Any leads? </p>