java - unable to execute a .sh script with Jsch -
java - unable to execute a .sh script with Jsch -
i'm trying execute script shell in unix server java application (on windows 7 station) using ssh api jsch.
the script shell i'm using "start_lm" c binary.
this code i'm using (it's jsch website exemples)
try{ jsch jsch=new jsch(); session session=jsch.getsession(user, host, 22); userinfo ui=new myuserinfo(); session.setuserinfo(ui); session.connect(); string command="user/psi/start_lm"; channel channel=session.openchannel("exec"); ((channelexec)channel).setcommand(command); channel.setinputstream(null); ((channelexec)channel).seterrstream(system.err); inputstream in=channel.getinputstream(); channel.connect(); while(true){ if(channel.isclosed()){ system.out.println("exit-status: "+channel.getexitstatus()); break; } try{thread.sleep(1000);}catch(exception ee){} } channel.disconnect(); session.disconnect(); }
the error i'm getting
exit-status: -1 mean
thanks ure help.
there's problem believe
". ./start_lm.sh
it should below provided script nowadays in current directory
"./start_lm.sh
as exit status 127
says
127 "command not found" illegal_command
java shell jsch
Comments
Post a Comment