Centos 7 上安裝 jdk 及問題小記
yum 下載安裝
yum -y list java 搜尋
# yum -y list 搜尋演示 $ yum -y list java Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * updates: mirrors.aliyun.com Available Packages java-1.6.0-openjdk.x86_64 1:1.6.0.41-1.13.13.1.el7 ... java-1.8.0-openjdk-headless.x86_64 l:1.8.0.212.b04-0.el7_6 java-1.8.0-openjdk.x86_64 1:1.8.0.212.b04-0.el7_6 # yum search jdk 搜尋演示 $ yum search jdk ====================================== N/S matched: jdk ====================================== copy-jdk-configs.noarch : JDKs configuration files copier java-1.8.0-openjdk.i686 : OpenJDK Runtime Environment 8 ... java-11-openjdk-debug.x86_64 : OpenJDK Runtime Environment 11 with full debug on
安裝 jdk
$ yum install java-1.8.0-openjdk.x86_64 Installed: java-1.8.0-openjdk.x86_64 1:1.8.0.292.b10-1.el7_9 Dependency Installed: atk.x86_64 0:2.28.1-2.el7 copy-jdk-configs.noarch 0:3.3-10.el7_5 giflib.x86_64 0:4.1.6-9.el7 gtk-update-icon-cache.x86_64 0:3.22.30-6.el7... xorg-x11-fonts-Type1.noarch 0:7.5-9.el7 Dependency Updated: chkconfig.x86_64 0:1.7.6-1.el7 Complete!
配置 JAVA_HOME 等環境變數
$ ls -l /usr/lib/jvm total 0 drwxr-xr-x 3 root root 16 Aug 3 22:53 java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64 lrwxrwxrwx 1 root root 21 Aug 3 22:53 jre -> /etc/alternatives/jre lrwxrwxrwx 1 root root 27 Aug 3 22:53 jre-1.8.0 -> /etc/alternatives/jre_1.8.0 lrwxrwxrwx 1 root root 35 Aug 3 22:53 jre-1.8.0-openjdk -> /etc/alternatives/jre_1.8.0_openjdk lrwxrwxrwx 1 root root 51 Aug 3 22:53 jre-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64 -> java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64/jre lrwxrwxrwx 1 root root 29 Aug 3 22:53 jre-openjdk -> /etc/alternatives/jre_openjdk
#set java environment JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64 PATH=$PATH:$JAVA_HOME/bin CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JAVA_HOME CLASSPATH PATH
完成安裝後驗證
$ java -version openjdk version "1.8.0_292" OpenJDK Runtime Environment (build 1.8.0_292-b10) OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
問題 Error: No matching Packages to list
cd /etc/yum.repos.d/ mv CentOS-Base.repo CentOS-Base.repo_bak
# 阿里雲yum源: wget -O /etc/yum.repos.d/CentOS-Base.repo yum clean all yum makecache
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70003733/viewspace-2885181/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Centos 7 安裝JDKCentOSJDK
- centos 7中 yum安裝jdkCentOSJDK
- CentOS Linux7 安裝JDKCentOSLinuxJDK
- CentOS 7安裝JDK1.8CentOSJDK
- CentOS7安裝Docker遇到的問題筆記CentOSDocker筆記
- CentOS 7 - 安裝Oracle JDK8CentOSOracleJDK
- Centos7x86安裝JDKCentOSJDK
- Centos 7 x86 安裝JDKCentOSJDK
- Centos7安裝jdk8CentOSJDK
- CentOS 7 yum 安裝與配置 JDKCentOSJDK
- (Linux)CentOS7下安裝JDK 1.8LinuxCentOSJDK
- Centos7安裝greenplum遇到的問題CentOS
- Centos7環境下安裝redis及常見的問題CentOSRedis
- CentOS 安裝 JDKCentOSJDK
- CentOS安裝jdkCentOSJDK
- ubuntu安裝jdk問題UbuntuJDK
- Docker架構及在Centos7上安裝dockerDocker架構CentOS
- Centos7上安裝dockerCentOSDocker
- CentOS 7下yum安裝Apache及不解析php問題的解決CentOSApachePHP
- CentOS如何安裝JDKCentOSJDK
- centos 安裝 jdk 8CentOSJDK
- 學習scala,java安裝jdk及jre的問題JavaJDK
- centos7透過yum安裝JDK1.8CentOSJDK
- linux 常用命令(五)——(centos7-centos6.8)JDK安裝LinuxCentOSJDK
- 在Centos7上安裝DockerCentOSDocker
- vmware 線上安裝 CentOS7CentOS
- 如何在 CentOS 7 上安裝 NginxCentOSNginx
- 熱門報導:CentOS7安裝[Mysql,JDK,TomCat]CentOSMySqlJDKTomcat
- RHEL 7.X 或CentOS 7 安裝 11.2.0.4 RAC碰到的問題CentOS
- centos安裝jdk8CentOSJDK
- VMware使用及CentOS 7安裝配置MXCentOS
- 如何在 CentOS 7 上安裝 Python 3CentOSPython
- Centos 7.x 線上安裝 KubernetesCentOS
- CentOS7上安裝和使用DockerCentOSDocker
- centos7上 IC工具的安裝CentOS
- Linux(CentOS)安裝JDK1.8LinuxCentOSJDK
- centos7.4 記一次 go安裝的問題,及目錄命令熟悉CentOSGo
- CentOS 7 安裝、配置、使用 PostgreSQL 10 安裝及基礎配置CentOSSQL