install java in linux
Setup Java by normal.
- Download from Oracle java for linux (jdk-7u45-linux-x64.tar.gz)
http://www.oracle.com/technetwork/java/javase/downloads/index.html
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
- Download from Oracle version rpm java for linux (jdk-7u40-linux-x64.rpm)
http://www.oracle.com/technetwork/java/javase/downloads/index.html - Setup RPM
rpm -i jdk-7u45-linux-x64.rpm
1
|
rpm -i jdk-7u45-linux-x64.rpm
|
No comments:
Post a Comment