title: Cannot run program "START": error=2, No such file or directory while trying to kill Chrome process in MAC
body: <p>My IDE is eclipse and I'm using <strong>Selenium Webdriver on MAC</strong>. Every time I execute my code below, I want to kill/close the previously opened browser and then start a new instance and leave it on. As a result, only one instance of browser should be open at a time. I am not doing this for testing purpose. I'm just doing this because I want to automate a task. </p>
  
  <p>This is the error I am getting everytime I execute my code:</p>
  
  <pre><code>Cannot run program "START": error=2, No such file or directory
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>public class Demo {
  
  public static void main(String[] args){
  
      System.setProperty("webdriver.chrome.driver", "/Users/Downloads/chromedriver/chromedriver");
      WebDriver driver = new ChromeDriver();
      driver.get("https://www.google.com/");
      try{
          Runtime.getRuntime().exec("START taskkill /F /IM chrome.exe");
          System.exit(0);
      }
      catch(IOException io){
          System.out.println(io.getMessage());
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This is working fine on <strong>windows</strong>. How do I fix this on <strong>MAC/unix/</strong> environment or what changes should I make in my code?</p>
  
  <p>I was told this error is something to do with <strong>admin privileges</strong> so I should run eclipse as an admin. So I did this: <code>sudo open Eclipse.app/</code> . So the eclipse opened as admin and executed the code but I was still getting the same error. </p>