How to write in Java to stdin of ssh?
问题 Everything works fine on the command line, but when I translate what I want into Java, the receiving process never gets anything on stdin. Here's what I have: private void deployWarFile(File warFile, String instanceId) throws IOException, InterruptedException { Runtime runtime = Runtime.getRuntime(); // FIXME(nyap): Use Jsch. Process deployWarFile = runtime.exec(new String[]{ "ssh", "gateway", "/path/to/count-the-bytes"}); OutputStream deployWarFileStdin = deployWarFile.getOutputStream();