title: Permission denied error in Java for chmod command
body: <p>I have an executable file (ffmpeg) that I'm trying to run with a Java program on a Mac. I used the Java program to send the command <code>chmod 777 /path/to/ffmpeg</code>, but when I try to run ffmpeg, I get the following error:</p>
  
  <pre><code>java.io.IOException: Cannot run program "/Users/james/WalkTheHall/ffmpeg": error=13, Permission denied
  </code></pre>
  
  <p>But when I run <code>chmod 777 /path/to/ffmpeg</code> from Terminal on my own before opening the Java application, the command to ffmpeg will run just fine in the Java program.</p>
  
  <p>Is there a difference between calling <code>chmod</code> from within the Java program and calling it on my own? Why will it not work? Thank you!</p>