Updating to JDK 7

So I updated my Ubuntu to 10.04.01 LTS and then updated my Java to version 7 release 1. Having been through traumatic update experience as I wrote in this blog post, I was rather reluctant at first to update to version 7. But I updated anyway. And surprise, surprise, it was not at all that complicated! It was almost magical. I did the following steps:
  1. I downloaded the JDK and extracted it into /usr/lib/jvm and renamed it to java-sun-1.7.0.1 to be compliant with the naming system of other Java versions.
  2. I changed the symlink java-6-sun to point to java-sun-1.7.0.1. (Previously it pointed to the directory java-sun-1.6.0.24).
  3. I edited the file .java-6-sun.jinfo. I changed only 2 lines in that file. I changed the first line, name=java-sun-1.7.0.1 (Previously it was name=java-sun-1.6.0.24). I also changed the priority number to 50. (The higher the priority number, the less prioritized it is).
  4. I did sudo update-java-alternatives -l and I saw that java-6-sun is listed.
  5. And then I called sudo update-java-alternatives -s java-6-sun. And it worked perfectly. No complaints at all. Well just one complaint: jdk alternative does not exist: /usr/lib/jvm/java-6-sun/bin/HtmlConverter. Well, I think that's not a problem.
  6. Done! I checked java -version and it did give me the correct version. I also opened Firefox and went to about:plugins, and the plugins were all at the correct version.
So, I guess.... that's it :)