title: Java get the hostname and other env var through jenkins
body: <p>I'm using jenkins to build my projects and i can't get the hostname with java</p>
  
  <p>According to this <a href="https://docs.oracle.com/javase/tutorial/essential/environment/env.html" rel="nofollow">java doc</a> I wrote the follow lines</p>
  
  <pre><code>            System.out.println(System.getenv("MACHINE"));
              System.out.println(System.getenv("HOSTNAME"));
  </code></pre>
  
  <p>These are environment variables. BUt the output on build is:</p>
  
  <pre><code> null
   null
  </code></pre>
  
  <p>What I'm doing wrong?</p>