Hi,
I need to connect th elinux machine through socket and need to execute the linux commands using java when i run the java application from any machine.I tried the following.But i am unable to execute the command when i run the program from windows.But if i run the program from linux,it works well.please correct me where am i wrong and please assist me to do this.
when running the above code,i am getting the following error:
Asterisk Call Manager/1.0
exception happened - here's what I know:
java.io.IOException: Cannot run program "ps": 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 RunCommand.main(RunCommand.java:20)
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
Thanks