Im trying to run a jsp file present in one unix server,which is trying to execute a python present in another unix server by doing ssh through a java code, which I placed inside the scriptlet tag in Jsp file, which has only user name and host IP address and remote path of the python script. My problem is the cmd present present in process variable is not getting executed,it is entering the try block but not executing the cmd .Is there any way to correct it. Please any one Help me out.
Below is my code
try {
Process p = Runtime.getRuntime().exec("loginusername loginusername@hostipaddress /path/python.py");
BufferedReader in = new BufferedReader(
new InputStreamReader(p.getInputStream()));
String line = null;
while ((line = in.readLine()) != null)
{
System.out.println(line);
}
} catch (IOException e) {
e.printStackTrace();
}