title: Executing killall command from Java
body: <p>I have to execute a command on Mac OS:</p>
  
  <pre><code>killall -KILL "Google Chrome"
  </code></pre>
  
  <p>When I execute it in terminal or run a .command file with this command it works.</p>
  
  <p>I tried this all in Java code</p>
  
  <pre><code>Runtime.getRuntime().exec("/usr/bin/killall -KILL \"Google Chrome\"");
  Runtime.getRuntime().exec("killall -KILL \"Google Chrome\"");
  Runtime.getRuntime().exec("/bin/bash -c \"killall -KILL \\\"Google Chrome\\\"\"");
  Runtime.getRuntime().exec("bash -c \"killall -KILL \\\"Google Chrome\\\"\"");
  Runtime.getRuntime().exec("/usr/bin/killall", new String[]{"-KILL", "Google Chrome"});
  Runtime.getRuntime().exec("killall", new String[]{"-KILL", "Google Chrome"});
  Runtime.getRuntime().exec("/bin/bash", new String[]{"-c", "killall -KILL \"Google Chrome\""});
  Runtime.getRuntime().exec("bash", new String[]{"-c", "killall -KILL \"Google Chrome\""});
  </code></pre>
  
  <p>And it doesn't work. </p>
  
  <p>What may be the problem?</p>