title: Ubuntu: where is java_home environment variable stored
body: <p>I have installed java by these commands:</p>
  
  <pre><code>sudo add-apt-repository ppa:webupd8team/java
  sudo apt-get update
  sudo apt-get install oracle-java7-installer
  sudo update-java-alternatives -s java-7-oracle
  </code></pre>
  
  <p>If I understood properly these commands above garantee that java will update automatically.
  I have been using Eclipse, STS and Tomcat successfully, then I believe that java is properly installed with its environments.</p>
  
  <p>But I want to know where is the java_home environment. I tried:</p>
  
  <ol>
  <li><p><code>gedit /etc/environment</code> I found:</p>
  
  <pre><code>PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$GRADLE_HOME/bin"
  GRADLE_HOME="/opt/gradle/gradle-1.6"
  </code></pre></li>
  <li><p><code>whereis java</code> (I believe that this is just a file find)</p>
  
  <pre><code>java: /usr/bin/java /usr/bin/X11/java /usr/share/java /usr/share/man/man1/java.1.gz
  </code></pre></li>
  <li><p><code>gedit ~/.pam_environment</code> But it is completely empty</p></li>
  <li><p><code>gedit ~/.bashrc</code> and after <code>gedit .profile</code> (I believe that this is just script files that run while starting linux). But I didn't find any string with "java".</p></li>
  <li><p><code>printenv JAVA_HOME</code> (I believe that this only prints variables set by export and it is valid only for the exact session you set) But nothing has printed.</p></li>
  </ol>
  
  <p>I am new to Linux. Could someone help me find where is the java environment in my system and please adjust any wrong believes I wrote before?</p>