1. Follow this link and select which version of the JDK to install. At the time of this writting the most current version is JDK 1.6 Update 3.
2. Accept (if we so desire) the licencing agreement and proceed to download the "Linux RPM in self-extracting file". Save this to your home directory.
3. From the command line, excecute the following:
chmod +x jdk-6u1-linux-i586-rpm.bin
./jdk-6u1-linux-i586-rpm.bin
4. Accept the next licencing agreement to extract the Java rpm. Then execute the following:
rpm -Uvh jdk-6u3-linux-i586.rpm
5. Once the RPM is installed we must still confirm that we are using the correct version of Java. To do so, excute the following.
/usr/sbin/alternatives --config java
the following will be displayed
There are 2 programs which provide 'java'.If "2" is not selected, then select it.
Selection Command
-----------------------------------------------
1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*+ 2 /usr/lib/jvm/jre-1.6.0-sun/bin/java
Enter to keep the current selection[+], or type selection number: 2
And there it is. We now have the latest version of Java installed and selected.
P.S.
Next posting will be on installing ant and other base components of the system.
External links
- CentOS Java