美文网首页
使用linux 命令行下载oracle官网jdk失败处理方法

使用linux 命令行下载oracle官网jdk失败处理方法

作者: yoqu | 来源:发表于2017-11-23 18:28 被阅读384次

    最近在服务器上安装jdk遇到一个问题,oracle官网下载jdk都需要同意它的license才能下载,所有直接使用wget xxx会下载到它的html文件,并不能下载真实文件。

    解决办法

    UPDATED FOR JDK 9 it looks like you can download it now directly from java.net without sending a header

    wget http://download.java.net/java/GA/jdk9/9/binaries/jdk-9+181_linux-x64_bin.tar.gz
    

    UPDATED FOR JDK 8u151
    TAR GZ:

    wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz
    

    UPDATED FOR JDK 8u151
    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/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz"
    RPM:
    
    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/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.rpm"
    

    UPDATED FOR JDK 8u131
    RPM:

      wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
    

    TAR GZ:

    wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
    

    RPM using curl:

    curl -v -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm > jdk-8u112-linux-x64.rpm
    

    UPDATE FOR JDK 7u79
    TAR GZ:

    wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz
    

    RPM using curl:

    curl -v -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.rpm > jdk-7u79-linux-x64.rpm
    

    相关文章

      网友评论

          本文标题:使用linux 命令行下载oracle官网jdk失败处理方法

          本文链接:https://www.haomeiwen.com/subject/hhqtbxtx.html