title: Installing Oracle Java on Linux Mint (instead of using OpenJDK) -- possible problems with linking
body: <p>I apologize in advance for the long query that'll follow, but I'm very lost and wanted to include all pertinent information.  </p>
  
  <p>Here is the system I started with:</p>
  
  <pre><code>Linux Mint 14 Nadia MATE
  64-bit Kernel
  OpenJDK version 1.7.0_21
  </code></pre>
  
  <p>I wanted to install Oracle Java 7 and have that be my system default.   </p>
  
  <p>Here is what I tried:</p>
  
  <p>1) Downloaded tar file of JDK1.7.0_21<br>
  2) Unpacked and moved it into /usr/lib/jvm/jdk1.7.0_21<br>
  3) <code>cd /usr/lib/jvm</code><br>
  4) <code>ln -s  jdk1.7.0_21 java-7-oracle</code><br>
  5) Created file <code>/usr/lib/jvm/.java-7-oracle.jinfo</code> and proceed to populate it with info such as:  </p>
  
  <pre><code>    alias=java-7-oracle
      priority=50
      section=non-free
  
      jre ControlPanel /usr/lib/jvm/java-7-oracle/jre/bin/ControlPanel
  
      jre java /usr/lib/jvm/java-7-oracle/jre/bin/java
      jre java_vm /usr/lib/jvm/java-7-oracle/jre/bin/java_vm
      jre javaws /usr/lib/jvm/java-7-oracle/jre/bin/javaws  
      ....  
  </code></pre>
  
  <p>6) Then, for some perhaps ill-thoughtout reasons, I abandoned this approach in favor of a shorter one that I felt I better understood. So I...  </p>
  
  <p>7) Deleted the symlink I had created  <code>rm java-7-oracle</code>  hoping that it would only remove the symlink.
  8) Proceeded to execute the following commands: </p>
  
  <pre><code>sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.*/bin/java 1065
  sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.*/bin/javac 1065
  sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.*/bin/javaws 1065
  sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.7.*/bin/jar 1065
  </code></pre>
  
  <p>9) <code>sudo update-alternatives --config java</code>
    And I picked this option:<br>
  <code>/usr/lib/jvm/jdk1.7.0_21/bin/java  1065   manual mode</code></p>
  
  <p>Afterwards, when I ran <code>java -version</code> I got errors saying Java Virtual Machine could not be started.</p>
  
  <p>Then, I went in and messed around a bit more, changed the priorities to 1, etc.. 
  I even made the following changes to my <code>/etc/profile</code>:<br>
           <code>JAVA_HOME=/usr/lib/jvm/jdk1.7.0_17</code><br>
           <code>PATH=$PATH:$JAVA_HOME/bin</code><br>
           <code>export JAVA_HOME</code><br>
           <code>export PATH</code><br>
  And loaded it: <code>. /etc/profile</code></p>
  
  <p>But I still can't get java to work. 
  The difference, though is that now when I run <code>java -version</code> I get:<br>
      <code>bash: /usr/bin/java: No such file or directory</code><br>
  I've also tried specifying the absolute path: <code>/usr/lib/jvm/jdk1.7.0_21/bin/java -version</code><br>
  But to no avail. </p>
  
  <p>Can someone please help me? I feel quite lost at this point.<br>
  And I can't seem to revert back to OpenJDK either. </p>
  
  <p>Thanks!</p>