I need to execute linux commands from JSP. It is working fine. But i need to start some sh file in a particular directory in linux through JSP. say /home/username/something/start.sh
try{
String command= "cd /home/username/something";
Runtime.getRuntime().exec(command);
Runtime.getRuntime().exec("./start.sh")
out.println("Child");
}
catch(Exception e)
{ out.println("Error");
}
It says FIle or Directory not found.
I tried Runtime.getRuntime().exec("pwd")
, It is showing something like "java.lang.UNIXProcess@fc9d2b" !! :O
I need to change the pwd and execute some commands through jsp. How can i do that?? Any help would be appreciated.