title: How to execute command with parameters?
body: <p>How am I to execute a command in Java with parameters?</p>
  
  <p>I've tried</p>
  
  <pre><code>Process p = Runtime.getRuntime().exec(new String[]{"php","/var/www/script.php -m 2"});
  </code></pre>
  
  <p>which doesn't work.</p>
  
  <pre><code>String[] options = new String[]{"option1", "option2"};
  Runtime.getRuntime().exec("command", options);
  </code></pre>
  
  <p>This doesn't work as well, because the <code>m</code> parameter is not specified.</p>