title: getting environment variable's value in java?
body: <p>I have set an environment variable in windows by name "sample". Can I get this environment variable's value using below code?</p>
  
  <pre><code>System.getProperty("sample");
  </code></pre>
  
  <p>in UAT environment I have LINUX OS. Can I set the same environment variable in LINUX OS and retrieve the same using <code>System.getProperty("sample")</code>?</p>
  
  <p>I mean does <code>System.getProperty("sample");</code> retrieves irrespective of the operating system?</p>
  
  <p>Also, I would like to get the environment variable's value in JSP.I know it is not recommended to keep logic in jsp but still, I need to use it. Can I use <code>System.getProperty("sample");</code> in jsp? Please help me.</p>