title: getenv function not returning expected answer
body: <p>I'm trying to access one of my environement variable, which is <code>JAVA_HOME</code>.
  To do so, I'm using <code>getenv()</code> function, like this :</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string.h&gt;
  
  int main() {
      const char* env = getenv("JAVA_HOME");
      if(env != NULL)
          std::cout &lt;&lt; "Environnement : " &lt;&lt; env &lt;&lt; std::endl;
      else
          std::cout &lt;&lt; "NULL" &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>I tryed <code>std::getenv("PATH");</code> which returns me something different from my file <code>/etc/bash.bashrc</code> where I put my <code>JAVA_HOME</code> variable.</p>
  
  <p>I expected <code>std::getenv("JAVA_HOME")</code> to return what I put in my <code>/etc/bash.bashrc</code> file. Now it returns something different.</p>
  
  <p>How can I get a correct environement variable ? What am I doing wrong ?</p>
  
  <p>I'm under Ubuntu 12.04 with GCC 4.7.2 using C++11 with QtCreator</p>
  
  <p>EDIT : Code</p>
  
  <ul>
  <li><p>Include[...] was a shorthand for the includes</p></li>
  <li><p>Added NULL handling</p></li>
  </ul>
  
  <p>EDIT : Progress</p>
  
  <ul>
  <li>I tryed <code>extern char **environ</code> but it doesn't contain the one variable I need ...</li>
  </ul>
  
  <p>EDIT : Partial Solution</p>
  
  <p>There's not way to do such things easily as I found out.
  I've set personal environment variables in the IDE to overcome the problem.</p>