简体   繁体   中英

Execute command line in PuTTY with java

So I am writing a program in java that launches PuTTY from the command line and then I need to be able to switch over to the PuTTY command line once it opens instead of my windows command line. How do I make that switch so I can continues to enter commands in PuTTY?

Basically you have to look into the ProcessBuilder .

The easy part is to use that to start putty. And when you are lucky, you can connect (pipe) the input/output streams into/from that process.

In other words: you will have to wire the parent process; and the child process using those streams; and then you might be able to read all output created by putty and write stuff there.

But that would require that putty prints the "connection" output into its stdout stream; something I very much doubt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM