I want to run a series of commands from Java. I came across few forums that explain how to execute multiple commands using getRuntime().exec(command) and defining command as String[]. But I want to input my password into the shell as well. The steps I am trying to do is.sudo suEnter passwordExecute a shell script that needs sudo access.Can anyone direct me here please?
Interactive Shell Session from Java
shell;java