title: How to run superuser commands on Linux through Java code?
body: <p>My application has multiple users and 1 superuser. I am trying to write and store a file in Linux through Java code but i get permission denied error. I used the following code:</p>
  
  <pre><code>Process process = Runtime.getRuntime().exec("/usr/bin/tiff2pdf -o /tmp/tiff_dir/temp.pdf /tmp/tiff_dir/image.tiff");
  int returnCode = process.waitFor();
  </code></pre>
  
  <p>I get following error:</p>
  
  <pre><code>java.io.FileNotFoundException: image.tiff (Permission denied)
  </code></pre>
  
  <p>From my analysis, it seems that because the user does not have root permissions, i am getting this error. What is the solution to this?</p>