Thursday, November 6, 2008

Installing JDK on RPM based distributions (CentOs, Redhat, Fedora)

Here’s how I installed JDK on Centos

"> Download

Go to http://java.sun.com/javase/downloads/index.jsp and download the desired file.

Extract the .bin file

[root@localhost tmp]# chmod 755 j2re-1_4_2_15-linux-i586-rpm.bin
[root@localhost tmp]# ./j2re-1_4_2_15-linux-i586-rpm.bin

Install the .rpm file

[root@localhost tmp]# rpm -Uvh j2re-1_4_2_15-linux-i586.rpm
Preparing... ########################################### [100%]
1:j2re ########################################### [100%]

Adjust environment

Finally add the path to the java executable in the /etc/profile file.

Test

$ java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)

No comments: