I have a weird problem while trying to execute a system process from within a Java program. Getting permission denied error:
java.io.IOException: Cannot run program "pwd.sh": error=13, Permission denied
Very similar to this: Permission denied error in Java for chmod command
It is working for me on one machine and not another. I have tried setting permissions to 777 on the pwd.sh file and no luck. The problem does not occur when I start the java program as 'user1', but it does occur when I start as root with 'sudo -u user1 java ...' (Which is what I ultimately need to do.)
So, any ideas what is going on? Is there a way in Eclipse to check my userid and present working directory before the program is called?