title: Java not finding environment variables defined in Jenkins
body: <p>I have a snippet of code that is obtaining an environment variable as follows: <code>System.getenv("MY_VAL")</code></p>
  
  <p>locally on my windows machine this works fine.</p>
  
  <p>However, on my Jenkins CI Server which is running CentOS I am encountering some issues</p>
  
  <p>I have tried setting the value of MY_VAL through both the envinject plugin as well as the global jenkins settings</p>
  
  <p>If i do a pre-build step to echo the value out, it works fine, however inside my java code this is not being resolved.</p>
  
  <p>How do I get this to be resolved?</p>