title: JAVA_HOME not working in ubuntu
body: <p>I am new to <code>ubuntu</code>. I am trying to use java-8. Where I have already installed java-6 in my <code>ubuntu</code> machine. I just want to use java-8 from my terminal (for test purpose); not from all over my machine. 
  I want java-6 remains for all other software like eclipse. I heard to to so we can <code>ubuntu</code> terminal to export. So I am trying  to do this -  </p>
  
  <pre><code>$ export JAVA_HOME=/usr/lib/jvm/jdk8
  $ export PATH=$PATH:$JAVA_HOME
  </code></pre>
  
  <p>after doing this when I type in terminal the fllowing command -  </p>
  
  <pre><code>$ java -version 
  </code></pre>
  
  <p>it gives - </p>
  
  <blockquote>
    <p>java version "1.6.0_29" Java(TM) SE Runtime Environment (build
    1.6.0_29-b11) Java HotSpot(TM) Server VM (build 20.4-b02, mixed mode)</p>
  </blockquote>
  
  <p>I tried several ways but nothing is working for me.</p>