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 7安裝JDK1.8CentOSJDK
- Centos7 安裝jdk 1.7CentOSJDK
- centos7 解除安裝openJDK 安裝jdk7CentOSJDK
- CentOS7安裝Docker遇到的問題筆記CentOSDocker筆記
- CentOS 7 yum 安裝與配置 JDKCentOSJDK
- Centos 7 x86 安裝JDKCentOSJDK
- Centos7x86安裝JDKCentOSJDK
- CentOS 7 - 安裝Oracle JDK8CentOSOracleJDK
- CentOS Linux7 安裝JDKCentOSLinuxJDK
- Centos7安裝jdk8CentOSJDK
- centos6.2安裝jdk7CentOSJDK
- CentOS7安裝MySQL衝突和問題解決小結CentOSMySql
- CentOS安裝jdkCentOSJDK
- CentOS 安裝 JDKCentOSJDK
- centos安裝及設定 jdk/tomcatCentOSJDKTomcat
- Centos7安裝greenplum遇到的問題CentOS
- Centos7環境下安裝redis及常見的問題CentOSRedis
- Centos7上安裝dockerCentOSDocker
- Centos6.5上安裝oracle 10.2.0.1小記CentOSOracle
- Centos6.5上安裝oracle 11.2.0.3小記CentOSOracle
- (Linux)CentOS7下安裝JDK 1.8LinuxCentOSJDK
- centos7原始碼安裝jdk1.7CentOS原始碼JDK
- Docker架構及在Centos7上安裝dockerDocker架構CentOS
- ubuntu安裝jdk問題UbuntuJDK
- CentOS 7下yum安裝Apache及不解析php問題的解決CentOSApachePHP
- Centos6.7安裝Pycharm及升級JDKCentOSPyCharmJDK
- CentOS如何安裝JDKCentOSJDK
- CentOS 安裝sun jdkCentOSJDK
- centos 安裝 jdk 8CentOSJDK
- centos7透過yum安裝JDK1.8CentOSJDK
- 如何在 CentOS 7 上安裝 NginxCentOSNginx
- 在Centos7上安裝DockerCentOSDocker
- 在CentOS 7上安裝TensorflowCentOS
- 如何在 CentOS 7 上安裝 DockerCentOSDocker
- CentOS 7 安裝Mono 及 Hello WorldCentOSMono
- CentOs下jdk的安裝CentOSJDK