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:
- 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.
- 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).
- 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).
- I did sudo update-java-alternatives -l and I saw that java-6-sun is listed.
- 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.
- 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.