title: Switch to JDK 7 in Amazon Linux
body: <p>I have t1.micro 64-bit instance, where I installed JDK 7 following some instructions (<code>sudo yum install java-1.7.0-openjdk-devel</code>)(<code>sudo yum update</code> etc). So, when I search for it, </p>
  
  <pre><code>sudo yum search openjdk
  </code></pre>
  
  <p>I get following-</p>
  
  <pre><code>java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
  java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
  java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
  java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
  java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
  java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
  java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
  java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
  java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
  java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
  </code></pre>
  
  <p>So, both are installed. But when I try to switch to JDK 7 using</p>
  
  <pre><code>sudo update-alternatives --config java 
  </code></pre>
  
  <p>I get-</p>
  
  <pre><code>There is 1 program that provides 'java'.
  
    Selection    Command
  -----------------------------------------------
  *+ 1           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
  </code></pre>
  
  <p>Why is it showing only the 6? </p>
  
  <p>I tried other commands like-</p>
  
  <pre><code>sudo update-alternatives --set javac /usr/lib/jvm/java-7-openjdk/bin/javac
  </code></pre>
  
  <p>but no success.</p>