Omnipresent IT Solutions Pvt Ltd

Saturday, February 7, 2009

Java on CentOS 5



Installing Java on CentOS 5:

Download the file.....

http://java.sun.com/javase/downloads/index.jsp

If you download the .bin file,,

In terminal,

chmod 777 filename

The file will become rpm file.. then simply type,

./filename

After installing... Path has to be set...

edit the bashrc file in /etc/bashrc

use gedit bashrc for editing..

Add the 2 lines..
export JAVA_HOME=/etc/Softwares/jdk1.6.0_12
export PATH=/etc/Softwares/jdk1.6.0_12/bin:$PATH

Give the path according to your installation...

execute the command:source bashrc

Finally Check: java -version.... It will give
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)

If it is properly installed..

No comments: