CentOS7安装JAVA JDK

  1. 作者QQ:67065435 QQ群:821635552

  2. 本站内容全部为作者原创,转载请注明出处!

安装JAVA_JDK准备

  1. 检查是否安装JDK

    rpm -qa|grep -E '^open[jre|jdk]|j[re|dk]'
    
  2. 卸载已安装JDK

    rpm -qa|grep Java|xargs rpm -e --nodeps
    

YUM安装JAVA_JDK

  1. yum安装jdk

    yum search java|grep jdk
    yum install java-1.8.0-openjdk
    
  2. 环境变量配置

    vim /etc/profile
    
    export JRE_HOME=$JRE_HOME:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre
    export JAVA_HOME=$JAVA_HOME:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64
    export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
    export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
    
    ESC
    :wq
    
  3. 检查安装是否成功

    java -version
    
    java version "1.8.0_101"
    Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
    

源码安装JAVA_JDK

  1. 命令行下载 JDK8

    cd /root
    wget --no-check-certificate --no-cookies \
    --header "Cookie:oraclelicense=accept-securebackup-cookie" \
    http://download.oracle.com/otn-pub/java/jdk/8u131-b13/jdk-8u131-linux-x64.tar.gz
    
  2. 解压并配置环境变量

    tar -zxvf jdk-8u131-linux-x64.tar.gz
    mv /root/jdk1.8.0_101 /usr/local/jdk
    
    vim /etc/profile
    
    export JAVA_HOME=$JAVA_HOME:/usr/local/jdk
    export JRE_HOME=$JRE_HOME:/usr/local/jdk/jre
    export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
    export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
    
    ESC
    :wq
    
    source /etc/profile
    
  3. 检查安装是否成功

    java -version
    
    java version "1.8.0_101"
    Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
    

JAVA下载大全

JAVA jdk8

  1. macOS x64

  2. Windows x86

  3. Windows x64

  4. Linux ARM 64 RPM Package

  5. Linux ARM 32 Hard Float ABI
  6. Linux ARM 64 Compressed Archive

  7. Linux x86 RPM Package

  8. Linux x64 RPM Package

  9. Linux x86 Compressed Archive

  10. Linux x64 Compressed Archive

  11. Solaris x64

  12. Solaris x64 (SVR4 package)
  13. Solaris SPARC 64-bit
  14. Solaris SPARC 64-bit (SVR4 package)

JAVA jdk15

  1. macOS Installer
  2. macOS Compressed Archive

  3. Windows x64 Installer

  4. Windows x64 Compressed Archive

  5. Linux ARM 64 RPM Package

  6. Linux ARM 64 Compressed Archive

  7. Linux x64 RPM Package

  8. Linux x64 Debian Package
  9. Linux x64 Compressed Archive
Copyright © 豆包嘿嘿~ 2012-∞ 冀ICP备17033181号 all right reserved,powered by Gitbook修订: 2020-11-11 02:43:28

results matching ""

    No results matching ""