jdk安装
- 查看centos自带的openjdk安装包:
rpm -qa | grep openjdkv -
卸载centos7的openjdk:
yum -y remove java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64 -
下载jdk1.8
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html -
解压jdk安装包
tar -xvf jdk-8u201-linux-x64.tar.gz vi /etc/profile
-
JAVA_HOME=/home/xxx/software/jdk1.8.0_201
JRE_HOME=/home/xxx/software/jdk1.8.0_201/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH -
是profile文件生效
sourece /etc/profile -
测试Java是否安装成功
java -version
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)