lost and found ( for me ? )

CentOS 6 32bit : how to install JRE


# cat /etc/centos-release ;uname -ri
CentOS release 6.3 (Final)
2.6.32-279.22.1.el6.i686 i386

Download an appropriate JRE from http://www.oracle.com/technetwork/java/javase/downloads/index.html
jre-6u41-linux-i586.bin

install JRE
# mv jre-6u41-linux-i586.bin tmp/
# cd tmp
# sh jre-6u41-linux-i586.bin

# ./jre1.6.0_41/bin/java -version
java version "1.6.0_41"
Java(TM) SE Runtime Environment (build 1.6.0_41-b02)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)


mv jre1.6.0_41 to /usr/local
mv jre1.6.0_41 /usr/local/


configure environments for Java
# cat /etc/environment
JAVA_HOME=/usr/local/jre1.6.0_41


configure PATH
# cat /root/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
       . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

export PATH


reboot the OS to see the environments are reflected.
# reboot

# echo $JAVA_HOME
/usr/local/jre1.6.0_41

# java -version
java version "1.6.0_41"
Java(TM) SE Runtime Environment (build 1.6.0_41-b02)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.