I have the exact same problem described here: SSH Output always empty
Unfortunately the accepted answer doesn't work for me, because
bufferedReader.readLine()
ends up in a loop, probably because of the missing end of line.
In addition I don't get why the code in the first posting doesn't work. Anyone with a deeper insight?
thx in advance
EDIT: if i do
while ((line = bufferedReader.readLine()) != null) {
stringBuilder.append(line);
stringBuilder.append('\n');
}
AFTER the ssh connection is closed, there is no endless loop, but the output is still empty...
stringBuilder.append(bufferedReader.read());
leads to -1 as output.
just:
stringBuilder.append(bufferedReader.readLine());
results in "null".
what is this madness? i don't get it...