安装JDK

安装JDK

  1. 下载JDK

    wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"  http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
    
  2. 解压

    tar -zxvf jdk-8u131-linux-x64.tar.gz
    
  3. 配置环境变量

    vi /etc/profile
    添加
    export JAVA_HOME=/usr/local/jdk1.8
    export JRE_HOME=${JAVA_HOME}/jre
    export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
    export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
    export PATH=$PATH:${JAVA_PATH}
    使profile生效
    source /etc/profie
    

你可能感兴趣的:(安装JDK)