0

I am new to java and from eclipse ( in windows ), i would like to trigger a shell script in a remote unix server. The shell script must run in the Unix server ; but the triggering must happen from the java code in Windows. How can I do this ?

I have tried SSHExec ; but I am getting "SSHExec type cannot be resolved to a type." error. Am I missing some import statements ? IF so, which will be the suitable import for this ?

  • 2
    How can we know what you're missing if you haven't posted any code? – LeonardBlunderbuss Mar 05 '14 at 07:13
  • refer [this answer](http://stackoverflow.com/a/21793314/1686291) for triggering shell script from java code, to trigger that on remote machine you can use [RMI](http://en.wikipedia.org/wiki/Java_remote_method_invocation), and for solution of your error, consider to post code here. – Not a bug Mar 05 '14 at 07:14
  • RMI seems like a way too complicated approach just to execute a remote command. I'd simply execute the "ssh..." command from within your Java application. – reto Mar 05 '14 at 07:16
  • One more doubt pls ... Runtime.getRuntime() can be used only if the shell script and the java code resides in the same server ? – user3382330 Mar 05 '14 at 09:40

0 Answers0