9/05/2014

Installing JDK 1.6, JDK 1.7 and JDK 1.8 from binary

You never know which one you need. Obviously if you have the luxury of a package manager, that will be better, especially if the PM supports multiple versions. Here I didn't have root permissions on a PC still I needed all versions; the switch can be made by sim-linking the proper version to ~/tools/jdk. Don't forget to download the files first - can't do wget since we have to accept the license agreement. Here we go:

JDK1.6

mv ~/Downloads/jdk-6u45-linux-x64.bin .
chmod +x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin

JDK1.7

mv ~/Downloads/jdk-7u67-linux-x64.tar.gz ~/tools
tar xvzf jdk-7u67-linux-x64.tar.gz

JDK1.8

mv ~/Downloads/jdk-8u11-linux-x64.tar.gz .
tar xvzf jdk-8u11-linux-x64.tar.gz
If you add ~/tools/jdk/bin to your PATH (via ~/.profile?), here's how touse jdk 1.8 as default:
ln -s ~/tools/jdk1.8.0_11 ~/tools/jdk

No comments:

Post a Comment