problem in calling rsh command Please help......

hi,

I want to execute some commands on unix through java, for this i want to run my program simulataneously on differnt machines so that i get data to compare.

I think i have to invoke the rsh command with the machine name for it but it is giving error as follows:

java.io.IOException: rsh eric52: not found

at java.lang.UNIXProcess.forkAndExec(Native Method)

at java.lang.UNIXProcess.<init>(UNIXProcess.java:71)

at java.lang.Runtime.execInternal(Native Method)

at java.lang.Runtime.exec(Runtime.java:582)

at java.lang.Runtime.exec(Runtime.java:505)

at java.lang.Runtime.exec(Runtime.java:471)

at RunCommand.get(RunCommand.java:18)

at RunCommand.main(RunCommand.java:80)

what should i do?

How do i run a command on a remote machine?

Please help me

[845 byte] By [rudza] at [2007-10-3 4:17:10]
# 1
Well you could always get your programs to talk to each other via RMI (for example)Otherwise I would script this using ant and use ssh since rsh is insecure. http://ant.apache.org/manual/OptionalTasks/sshexec.html
YoGeea at 2007-7-14 22:18:44 > top of Java-index,Java Essentials,Java Programming...
# 2
Javaworld has a good whitepaper on runtime trapssearch for "JavaWorld Runtime Exec Traps" and you should find it.
masijade.a at 2007-7-14 22:18:44 > top of Java-index,Java Essentials,Java Programming...
# 3
Thanks for the replies,How to send commands through ssh ?I have no idea how to go about it?Can anyone tell me?
rudza at 2007-7-14 22:18:44 > top of Java-index,Java Essentials,Java Programming...