1. download jdkjava
jdk-7u60-linux-x64.tar.gzlinux
2. unzip jdk-file to /usr/lib/jvm/.app
/usr/lib/jvm/jdk1.7.0_60jvm
3. set environmentip
vi /etc/profile, add
#set java environment
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATHit
4. enable profileio
execute
source /etc/profile
to enable java environmentjdk
5. set default appdate
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_60/bin/java 17060file
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_60/bin/javac 17060
update-alternatives --config java
6. check the installation with:java -version