My program is running on ubuntu 10.04 ,and here is the code :
Process process=Runtime.getRuntime().exec("ls",null,null);
it throw an exception of :
Cannot run program "ls": java.io.IOException: error=2, No such file or directory,
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")
and then i change the code to :
Process process=Runtime.getRuntime().exec("/bin/ls",null,null);
it throw an exception of :
Cannot run program "/bin/ls": java.io.IOException: error=13, Permission denied
I have changed privilege of all the related files and directories to 777 so i really don't know what's wrong with it.
Thank you for your replies .