| Installing Specific Versions of Java on Ubuntu |
|
|
|
| Written by Josh B |
| Wednesday, 11 May 2011 12:31 |
|
While its very easy to install the standard versions of Java in Ubuntu, some times you will want to install a specific version of Java. This makes tasks like deployment and testing much easier since you know exactly the version of Java you are coding against. To do this, use the following steps...
For example, I wanted to JDK 1.6.0.25. First I had to go to Oracle (not Sun anymore) and download the installer. I then extracted it and put the directory in /usr/lib/jvm/ . For me, once I had unpacked the directory, the new JDK was in a directory called jdk1.6.0_25. For completeness, I rename this to java-6-sun4josh-1.6.0.24. NB: I added the "4josh" part so it wouldn't get affected by any future updates. sudo mv ~/Downloads/jdk1.6.0_25 /usr/lib/jvm In /usr/lib/jvm there are files like .java-1.5.0-sun.jinfo and .java-6-sun.jinfo . We need to make one ourselves : sudo cp .java-6-sun.jinfo .java-6-sun4josh-1.6.0.25.jinfo Now edit it using: sudo gedit .java-6-sun4josh-1.6.0.25.jinfo You will need to change the name and alias as well as the paths to point your version of java. chmod 755 update-java This should pick up your new version of Java. java -version Eg: Java(TM) SE Runtime Environment (build 1.6.0_25-b06) |
| Last Updated on Wednesday, 11 May 2011 12:40 |




