3

My Method:

public static void executeCommand(String command)
{
    try {
        Process p = new ProcessBuilder("gnome-terminal", "-e", command).start();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

How do I start the Terminal with sudo permission?

Sean Bright
  • 118,630
  • 17
  • 138
  • 146
  • 2
    take a look at this: http://stackoverflow.com/questions/18708087/how-to-execute-bash-command-with-sudo-privileges-in-java – Wiz Sep 01 '15 at 20:16
  • Check out this answer here: http://stackoverflow.com/questions/18708087/how-to-execute-bash-command-with-sudo-privileges-in-java – Tim Davidson Sep 01 '15 at 20:17

0 Answers0