title: alternatives config does not change java version in CentOS
body: <p>I am installing Jdk 1.8 in centos 6.4 machine. </p>
  
  <p>java -version</p>
  
  <blockquote>
    <p>java version "1.7.0_67"
    Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
    Java HotSpot(TM) 64-Bit Server VM (busudo yum install dsc21-2.1.13-1 cassandra2.1.6-1
    <a href="https://i.stack.imgur.com/qgDEi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qgDEi.png" alt="enter image description here"></a>ild 24.65-b04, mixed mode)</p>
  </blockquote>
  
  <p>I downloaded jdk 1.8 from Oracle website and installed it.</p>
  
  <blockquote>
    <p>alternatives --install /usr/bin/java java /opt/jdk1.8.0_77/bin/java 2</p>
  </blockquote>
  
  <p>once it is installed, I used </p>
  
  <blockquote>
    <p>alternatives --config java </p>
  </blockquote>
  
  <p>to set the current java version to 1.8.</p>
  
  <ul>
  <li>There are 3 programs which provide 'java'.</li>
  </ul>
  
  <h2>  Selection    Command</h2>
  
  <ul>
  <li>1           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java<br>
  2           /opt/jdk1.8.0_77/bin/java</li>
  <li>3           /opt/jdk1.8.0_91/bin/java</li>
  </ul>
  
  <p>I picked the 3rd option after which java -version does not change anything. Its still showing the same old 1.7 version. I tried appending newly installed java directory to the PATH variables and then changed JAVA_HOME and JRE_HOME to point newly installed java directories both of which did not yield any outcome.</p>
  
  <p>Just wondering if I am missing any step here.</p>
  
  <p>Thanks!</p>
  
  <p><a href="https://i.stack.imgur.com/qgDEi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qgDEi.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/52zx7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/52zx7.png" alt="enter image description here"></a></p>