title: JAVA_HOME and PATH are set but java -version still shows the old one
body: <p>I am using Linux Mint Cinnamon 14. I have set the <code>$JAVA_HOME</code> and <code>$PATH</code> environment variables in <code>~/.profile</code> as follows:</p>
  
  <pre><code>export JAVA_HOME=/home/aqeel/development/jdk/jdk1.6.0_35
  export PATH=/home/aqeel/development/jdk/jdk1.6.0_35/bin:$PATH
  </code></pre>
  
  <p>I then did <code>source ~/.profile</code> to make the proper changes.</p>
  
  <p>When I execute <code>java -version</code> command to check the active java version, it shows the default (already installed open-jdk) java version. How can I override the default open-jdk with the one I downloaded?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p><code>which java</code> says /usr/bin/java</p>
  
  <p><code>$JAVA_HOME/bin/java -version</code> says 'Permission Denied'</p>
  
  <p><code>sudo $JAVA_HOME/bin/java -version</code> (asks for password, then) says Command not found</p>
  
  <p>but <code>cd $JAVA_HOME/bin</code>, and <code>ls</code> shows that it is right directory.</p>