JDK安装

环境

系统:CentOS 6.8
软件:jdk-8u40-linux-x64.tar.gz

jdk安装

  • 下载二进制包
    地址:http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html

  • 安装

    # tar -xzvf jdk-8u40-linux-x64.tar.gz
    # mv jdk1.8.0_40 /usr/local/jdk
    
  • 配置环境变量

    # vim /etc/profile
    export JAVA_HOME=/usr/local/jdk
    export PATH=$JAVA_HOME/bin:$PATH
      
    # source /etc/profile
    
  • 查看版本

    # java –version
    java version "1.8.0_40"
    Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
    Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
    

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