zoukankan      html  css  js  c++  java
  • Linux 安装 JDK 8

    1. step1: 下载最新的 Java Archive 

    # wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie"    "http://download.oracle.com/otn-pub/java/jdk/10.0.2+13/19aef61b38124481863b1413dce1855f/jdk-10.0.2_linux-x64_bin.tar.gz"

    # wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie"  "http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.tar.gz"

    # wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie"    "https://download.java.net/openjdk/jdk7u75/ri/openjdk-7u75-b13-linux-x64-18_dec_2014.tar.gz"

    # tar xzf jdk-10.0.2_linux-x64_bin.tar.gz  -C /opt/

    2. step2: 安装 Java 8 with Alternatives

    # cd /opt/jdk1.8.0_171/
    # alternatives --install /usr/bin/java java /opt/jdk1.8.0_171/bin/java 2
    # alternatives --config java


    There are 3 programs which provide 'java'.

      Selection    Command
    -----------------------------------------------
    *  1           /opt/jdk1.7.0_71/bin/java
    + 2           /opt/jdk1.8.0_45/bin/java
       3           /opt/jdk1.8.0_144/bin/java
       4           /opt/jdk1.8.0_171/bin/java

    Enter to keep the current selection[+], or type selection number: 4

    # alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_171/bin/jar 2
    # alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_171/bin/javac 2
    # alternatives --set jar /opt/jdk1.8.0_171/bin/jar
    # alternatives --set javac /opt/jdk1.8.0_171/bin/javac

    3. step3: 检查刚刚安装的Java版本

    # java -version

    java version "1.8.0_171"
    Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
    Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

    4. step4: 配置Java环境变量

    # export JAVA_HOME=/opt/jdk1.8.0_171
    # export JRE_HOME=/opt/jdk1.8.0_171/jre
    # export PATH=$PATH:/opt/jdk1.8.0_171/bin:/opt/jdk1.8.0_171/jre/bin

  • 相关阅读:
    简单的描述关于开发部署产生401,500的错误处理
    文件的批量打包下载
    json的序列化与反序列化
    实现MD5的加密和解密
    dropdownlist的OnSelectedIndexChanged方法不触发
    sqlserver错误2,error 40
    C#存储过程调用的三个方法
    SQL Server 错误:924 解决方法
    判断是否在时间间隔内
    切面添加日志
  • 原文地址:https://www.cnblogs.com/yuzg/p/9268063.html
Copyright © 2011-2022 走看看