title: Java Runtime exec throws no such file or permission denied
body: <p>My program is running on ubuntu 10.04 ,and here is the code :</p>
  
  <pre><code>Process process=Runtime.getRuntime().exec("ls",null,null);
  </code></pre>
  
  <p>it throw an exception of : </p>
  
  <pre><code>Cannot run program "ls": java.io.IOException: error=2, No such file or directory,  
  </code></pre>
  
  <p>and i tried to change "ls " to "chmod" ,"pwd" ,i found no one shell command work, all came to the same problem .(I also tried "/bin/sh -c ls")</p>
  
  <p>and then i change the code to :</p>
  
  <pre><code>Process process=Runtime.getRuntime().exec("/bin/ls",null,null);
  </code></pre>
  
  <p>it throw an exception of : </p>
  
  <pre><code>Cannot run program "/bin/ls": java.io.IOException: error=13, Permission denied
  </code></pre>
  
  <p>I have changed privilege of all the related files and directories to 777 so i really don't know what's wrong with it.</p>
  
  <p>Thank you for your replies  .</p>