I am trying to use SSH. I downloaded a jar file from jscape!!! I am able to connect to the machine.... I have written this code for the connection please check...
Ssh ssh = null;
Process process = null;
String command = "ksh abc.sh";
ssh = new Ssh(Login_Credentials.iP, Login_Credentials.userName, Login_Credentials.passWord);
System.out.println("Connecting Please Wait...");
ssh.connect();
System.out.println("Connected!!!");
process = Runtime.getRuntime().exec(command);
System.out.println("Done!!!");
When I run this code... I get the error message.....
java.io.IOException: Cannot run program "ksh": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at com.b2b.Heal_Check.HealtCheckAutomation.main(HealtCheckAutomation.java:40)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 5 more