Reputation: 8488
I am running the following code in Java for running a shell script in Ubuntu. But when it is running, y=the putty terminal will be displayed. But i dont want this. How will I hide this terminal.
ProcessBuilder pb = new ProcessBuilder(winBasePath + "putty.exe", "-ssh", "-m", winBasePath + "runHiveCmd.txt", linuxSystem, "-pw", linuxPwd);
Process p = pb.start();
try {
p.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
Upvotes: 0
Views: 488
Reputation: 18459
If performing a remote command via ssh, consider jsch. This provides cleaner integration does not require ProcessBuilder. Here is an example you could start with
Upvotes: 1
Reputation: 159754
Try this
ProcessBuilder pb =
new ProcessBuilder("cmd.exe", "/C", "START", "/MIN", winBasePath + "putty.exe", ...);
Upvotes: 2