title: Java installation in Ubuntu
body: <p>I am trying to install jre-7u51-linux-i586 in Ubuntu. The problem is after all installation, getting below Error:</p>
  
  <p>$:/usr/local/java$ java -version </p>
  
  <p>The program 'java' can be found in the following packages:</p>
  
  <ul>
  <li>default-jre</li>
  <li>gcj-4.6-jre-headless</li>
  <li>openjdk-6-jre-headless</li>
  <li>gcj-4.5-jre-headless</li>
  <li>openjdk-7-jre-headless
  Try: sudo apt-get install </li>
  </ul>
  
  <p>I have tried installing via webupd8, still same issue. Please help.</p>
  
  <p>Thanks for the help you provided. Still I am at bay.</p>
  
  <p>I am getting below error when I am trying to do update-alternatives:</p>
  
  <p>$ sudo update-alternatives --remove "java" "/usr/lib/jvm/jdk1.7.0_25/bin/java"
  update-alternatives: warning: forcing reinstallation of alternative /usr/local/java/jre1.7.0_25/bin/java because link group java is broken.
  update-alternatives: warning: not replacing /usr/bin/java with a link.</p>
  
  <p>Also I am getting below for the java versions installed.
  ~/Softwares$ sudo update-alternatives --display java
  java - manual mode
    link currently points to /usr/local/java/jre1.7.0_25/bin/java
  /usr/lib/jvm/jdk1.7.0_51/bin/java - priority 1
  /usr/local/java/jre1.7.0_25/bin/java - priority 1
  Current 'best' version is '/usr/lib/jvm/jdk1.7.0_51/bin/java'.</p>
  
  <p>I have removed java as: sudo apt-get purge openjdk-*
  I am bit newbie in Linux, please help.</p>