Saturday, April 4, 2015

install java in linux

install java in linux


 Setup Java by normal.


tar -xzf jdk-7u45-linux-x64.tar.gz mv jdk1.7.0_45 /opt/
1
2
tar -xzf jdk-7u45-linux-x64.tar.gz
mv jdk1.7.0_45 /opt/

  • Setup Java

cd /opt/jdk1.7.0_45 alternatives --install /usr/bin/java java /opt/jdk1.7.0_45/bin/java 1 alternatives --config java
1
2
3
cd /opt/jdk1.7.0_45
alternatives --install /usr/bin/java java /opt/jdk1.7.0_45/bin/java 1
alternatives --config java

  • Set JAVA_HOME

export JAVA_HOME=/opt/jdk1.7.0_45 export JRE_HOME=/opt/jdk1.7.0_45/jre export PATH=$PATH:/opt/jdk1.7.0_45/bin:/opt/jdk1.7.0_45/jre/bin
1
2
3
export JAVA_HOME=/opt/jdk1.7.0_45
export JRE_HOME=/opt/jdk1.7.0_45/jre
export PATH=$PATH:/opt/jdk1.7.0_45/bin:/opt/jdk1.7.0_45/jre/bin

2.      Setup Java by RPM


rpm -i jdk-7u45-linux-x64.rpm
1
rpm -i jdk-7u45-linux-x64.rpm

No comments:

Post a Comment