title: How to execute bash command with sudo privileges in Java?
body: <p>I'm using ProcessBuilder to execute bash commands:</p>
  
  <pre><code>import java.io.IOException;
  
  public class Main {
      public static void main(String[] args) {
          try {
              Process pb = new ProcessBuilder("gedit").start();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>But I want to make something like this:</p>
  
  <pre><code>Process pb = new ProcessBuilder("sudo", "gedit").start();
  </code></pre>
  
  <p>How to pass superuser password to bash? </p>
  
  <p><code>("gksudo", "gedit")</code> will not do the trick, because it was deleted since Ubuntu 13.04 and I need to do this with available by default commands.</p>
  
  <p>EDIT</p>
  
  <p>gksudo came back to Ubuntu 13.04 with the last update.</p>