title: How to get current user name of Linux in Java
body: <p>I have a Selenium tests written in Java which runs as Jenkins job. I need to have chmod set up to 777 cause otherwise it throws me an error. But I would like to set up chmod properly to somenthing like 775. The problem is that I dont know who is the user which runs the Java tests. I have this code in Java</p>
  <pre><code>System.out.println(Runtime.getRuntime().exec(&quot;whoami&quot;));
  </code></pre>
  <p>which returns this: <strong>Process[pid=2116487, exitValue=0]</strong> Can somebody tell me please what is it? Obviously it is not a user I can set up as owner or as a group of the repository.</p>
  <p>Thanks.</p>