Runtime.exec problem
Hi,
I created a .sh file called run.sh and it's located in the following path:
/opt/orod
it must execute a class was locatated in
/opt/orod/com/carriex
I want to run it via a web page (I use JSF in web tier), so, I coded a method in a bean and placed in the followin path
/opt/tomcat/webapps/carriex//WEB-INF/classes/com/carriex/web/ui/beans
the part of my method is like this:
. . .
String shDir = "/opt/orod";
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("./run.sh" + " " + shDir);
. . .
but, when I call this method by cliking on the button in a jsp, I have got the below exception:
Caused by: java.io.IOException: java.io.IOException: ./run.sh: not found
However, when I've changed it to this,
Process proc = runtime.exec("/bin/sh" + " " + "./run.sh" + " " + shDir);
I dont get any errors, but run.sh file doesnt work!!!!
Do you have any suggestion?
Orod Semsarzadeh
null

