1

I am trying to execute binary program (work with putty) on a Linux server, from java using jsch library:

Channel channel = null;
channel = session.openChannel("exec");
String command = "/users/let/Infot";
((ChannelExec) channel).setCommand(command );
((ChannelExec) channel).setPty(true);

OutputStream out = channel.getOutputStream();
InputStream inputStream = channel.getInputStream();
channel.connect();

The error:

error while loading shared libraries: libgrt1.so: cannot open shared object file: No such file or directory

In program like putty program works fine.

I am not allowed to change anything on the remote machine, and concatenating execution command with PATH doesn't help

command = "PATH=\"$PATH;/users/lib\" ; /users/let/Infot";


command = "PATH=\"$PATH;/users/lib\" && /users/let/Infot";
YerivanLazerev
  • 353
  • 3
  • 17

0 Answers0