标签:plugins file serve 修改 usr remove cached loading yum安装
[root@centos76 ~]# yum -y list java* Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * elrepo: mirrors.neusoft.edu.cn * epel: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com Installed Packages ...
[root@centos76 ~]# yum install -y java-1.8.0-openjdk* Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile epel/x86_64/metalink | 6.5 kB 00:00:00 * base: mirrors.aliyun.com * elrepo: mirrors.neusoft.edu.cn * epel: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com ...
[root@centos76 ~]# java -version openjdk version "1.8.0_222" OpenJDK Runtime Environment (build 1.8.0_222-b10) OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
自动安装jdk的路径是在/usr/lib/jvm。
[root@centos76 jvm]# rpm -qa| grep jdk copy-jdk-configs-3.3-10.el7_5.noarch java-1.8.0-openjdk-javadoc-1.8.0.222.b10-1.el7_7.noarch java-1.8.0-openjdk-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-accessibility-debug-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-devel-debug-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-debug-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-src-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-accessibility-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-javadoc-zip-1.8.0.222.b10-1.el7_7.noarch java-1.8.0-openjdk-headless-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-demo-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-src-debug-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-demo-debug-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-devel-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-javadoc-debug-1.8.0.222.b10-1.el7_7.noarch java-1.8.0-openjdk-headless-debug-1.8.0.222.b10-1.el7_7.x86_64 java-1.8.0-openjdk-javadoc-zip-debug-1.8.0.222.b10-1.el7_7.noarch
[root@centos76 jvm]# yum -y remove java-1.8.0-openjdk-headless-1.8.0.222.b10-1.el7_7.x86_64
在https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html中选择合适的版本进行下载,然后上传到linux的/usr/local/java文件夹下。
使用如下命令解压压缩包:
tar zxvf jdk-8u66-linux-x64.tar.gz
删除压缩包:
rm -rf jdk-8u66-linux-x64.tar.gz
修改/etc/profile,添加如下内容:
JAVA_HOME=/usr/local/java/jdk1.8.0_221 PATH=$JAVA_HOME/bin:$PATH export PATH JAVA_HOME
source /etc/profile
java -version
标签:plugins file serve 修改 usr remove cached loading yum安装
原文地址:https://www.cnblogs.com/zhuzhaoli/p/11669832.html