CentOS 7 linux 卸载和安装JDK

#JAVA_HOME=/usr/java/jdk1.6.0_45;export JAVA_HOME
JAVA_HOME=/usr/java/jdk1.7.0_79;export JAVA_HOME 
#CLASSPATH=$JAVA_HOME/lib;export CLASSPATH
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar;export CLASSPATH 
PATH=$JAVA_HOME/bin:$PATH;export PATH
JRE=$JAVA_HOME/jre;export JRE 

Root  login !
[root@localhost ~]# rpm -qa|grep jdk
java-1.8.0-openjdk-1.8.0.45-30.b13.el7_1.x86_64
java-1.7.0-openjdk-1.7.0.79-2.5.5.2.el7_1.x86_64
java-1.7.0-openjdk-headless-1.7.0.79-2.5.5.2.el7_1.x86_64
java-1.7.0-openjdk-devel-1.7.0.79-2.5.5.2.el7_1.x86_64
java-1.8.0-openjdk-headless-1.8.0.45-30.b13.el7_1.x86_64
jdk-1.6.0_45-fcs.x86_64
java-1.8.0-openjdk-devel-1.8.0.45-30.b13.el7_1.x86_64
[root@localhost ~]# rpm -e jdk-1.6.0_45-fcs.x86_64
[root@localhost java]# rpm -ivh jdk-7u79-linux-x64.rpm
[root@localhost java]# cd jdk1.7.0_79/
[root@localhost jdk1.7.0_79]# vi /home/latte/.bashrc
[root@localhost jdk1.7.0_79]# source /home/latte/.bashrc
=======================================================================
JAVA_HOME=/usr/java/jdk1.7.0_79;export JAVA_HOME
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar;export CLASSPATH
PATH=$JAVA_HOME/bin:$PATH;export PATH
JRE=$JAVA_HOME/jre;export JRE
=======================================================================

CentOS 7 linux 卸载和安装JDK_第1张图片

你可能感兴趣的:(centos)