Alex Rivera | Logout

Permission denied error in Java for chmod command

Asked 2010-06-21T15:15:13.137
12

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 chmod 777 /path/to/ffmpeg, but when I try to run ffmpeg, I get the following error:

java.io.IOException: Cannot run program "/Users/james/WalkTheHall/ffmpeg": error=13, Permission denied

But when I run chmod 777 /path/to/ffmpeg from Terminal on my own before opening the Java application, the command to ffmpeg will run just fine in the Java program.

Is there a difference between calling chmod from within the Java program and calling it on my own? Why will it not work? Thank you!

Edit
Report

1 Answer

4

I'd guess that chmod is a shell command, not an executable. Try running chmod through your shell. See more details here: Want to invoke a linux shell command from Java

answered 2010-06-21T15:22:52.447

Your Answer