Programing

wget을 통해 Linux에서 Java JDK를 다운로드하면 대신 라이센스 페이지가 표시됩니다.

lottogame 2020. 10. 3. 09:46
반응형

wget을 통해 Linux에서 Java JDK를 다운로드하면 대신 라이센스 페이지가 표시됩니다.


Oracle에서 Java를 다운로드하려고하면 대신 OTN 사용 조건에 동의해야한다는 내용의 페이지가 다운로드됩니다.

죄송합니다!

Oracle Technology Network에서 제품을 다운로드하려면 OTN 라이센스 조건에 동의해야합니다.

확실히 ...

  • 귀하의 브라우저에는 "쿠키"와 JavaScript가 활성화되어 있습니다.
  • 다운로드하려는 제품에 대해 "라이센스 동의"를 클릭했습니다.
  • 라이센스에 동의 한 후 30 분 이내에 다운로드를 시도합니다.

Java를 다운로드하고 설치하려면 어떻게합니까?


Oracle JDK 11 용으로 업데이트 됨

wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/11+28/55eed80b163941c8885ad9298e6d786a/jdk-11_linux-x64_bin.tar.gz

JDK 10.0.2 용으로 업데이트 됨

wget --no-check-certificate -c --header "Cookie: 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

JDK 10.0.1 용으로 업데이트 됨

wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/10.0.1+10/fb4372174a714e6b8c52526dc134031e/jdk-10.0.1_linux-x64_bin.tar.gz

JDK 9 용으로 업데이트 됨 이제 헤더를 보내지 않고 java.net에서 직접 다운로드 할 수있는 것 같습니다.

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

JDK 8u191 용으로 업데이트 됨

TAR GZ :

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3a%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk8-downloads-2133151.html; oraclelicense=accept-securebackup-cookie;" "https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz"

RPM :

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3a%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk8-downloads-2133151.html; oraclelicense=accept-securebackup-cookie;" "https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.rpm"

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

curl을 사용한 RPM :

 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

위의 모든 경우에서 'x64'를 'i586'으로 대체하여 32 비트 빌드를 다운로드하십시오.

  • -j- > 정크 쿠키
  • -k- > 인증서 무시
  • -L- > 리디렉션 따르기
  • -H [arg] -> 헤더

curl대신 사용할 수 있습니다 wget.

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

curl을 사용한 RPM :

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

다시 한 번 다운로드중인 버전에 대한 올바른 URL을 지정했는지 확인하십시오. URL은 여기에서 찾을 수 있습니다. Oracle JDK 다운로드 사이트

2012 년 6 월 9 일의 원래 답변

를 사용하여 명령 줄에서 Oracle JDK를 다운로드하려는 wget경우 해결 방법이 있습니다. wget다음과 같이 명령을 실행하십시오 .

wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz"

다운로드 링크를 다운로드중인 버전에 맞는 링크로 바꾸십시오.


( Irani 가 내 대답을 업데이트했지만 여기에 모든 것을 명확히합니다. )

편집 : 2018 년 10 월 16 일에 릴리스 된 Java 11.0.1 업데이트

Wget

wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/11.0.1+13/90cf5d8f270a4347a95050320eef3fb7/jdk-11.0.1_linux-x64_bin.tar.gz

JRE 8u191 (쿠키 플래그 없음) : http://javadl.oracle.com/webapps/download/AutoDL?BundleId=235717_2787e4a523244c269598db4e85c51e0c
자세한 내용은 oracle.comjava.com 에서 다운로드를 참조하십시오 .

  • -c / --continue

    완료되지 않은 다운로드를 계속할 수 있습니다.

  • --header "Cookie: oraclelicense=accept-securebackup-cookie"

    2014 년 3 월 15 일 부터이 쿠키는 라이센스 계약에 동의 한 후 사용자에게 제공 되며 download.oracle.com 에서 Java 패키지에 액세스하는 데 필요합니다 . 2012 년 3 월 27 일 의 이전 (및 첫 번째) 구현 에서는 쿠키를 사용했습니다 gpw_e24=http%3A%2F%2Fwww.oracle.com[...]. 두 사건 모두 공개되지 않은 채로 남아 있습니다.

    값이 " accept-securebackup-cookie"일 필요는 없습니다 .

Wget <1.13에 필요

  • --no-check-certificate

    주체 대체 이름 (SAN) 인증서 (주로 Red Hat Enterprise Linux 6.x 및 CentOS와 같은 친구)를 지원 하지 않는 wget 1.12 및 이전 버전 에서만 필요합니다 . 1.13은 2011 년 8 월 출시 되었습니다.

    현재 버전을 보려면 다음을 사용하십시오. wget --version | head -1

필요하지 않음

  • --no-cookies

    이 조합 --no-cookies --header "Cookie: name=value"은 " 공식 "쿠키 지원 으로 언급 되지만 여기에서 반드시 필요한 것은 아닙니다.

곱슬 곱슬하다

curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O http://download.oracle.com/otn-pub/java/jdk/11.0.1+13/90cf5d8f270a4347a95050320eef3fb7/jdk-11.0.1_linux-x64_bin.tar.gz
  • -L / --location

    cURL 이 모든 미러를 통해 리디렉션하는 데 필요합니다 .

  • -C / --continue-at -

    위 참조. cURL에는 -끝에 대시 ( )가 필요합니다 .

  • -b / --cookie "oraclelicense=accept-securebackup-cookie"

    과 동일 -H / --header "Cookie: ..."하지만 파일도 허용합니다.

  • -O

    cURL 이 파일을 저장하는 데 필요 합니다 ( 더 많은 차이점 작성자의 비교 참조 ).


명령 줄에서 Java를 다운로드하는 것은 항상 번거 롭습니다. 내가 능률적으로했던 것은 FireFox (다른 브라우저가 작동 할 수 있음)를 사용하여 내 랩톱에서 다운로드를 시작하고 일시 중지 (다운로드 창 내에서) 한 다음 컨텍스트 메뉴의 "다운로드 링크 복사"메뉴 항목을 사용하여 파일 다운로드. 그런 다음이 URL을 Linux 상자에서 사용하여 동일한 파일을 다운로드 할 수 있습니다. URL의 수명이 짧을 것으로 예상합니다. 추악하지만 일반적으로 성공적입니다.


JDK 8u171 RPM 용으로 업데이트 됨

wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.rpm

아래의 오래된 링크

JDK 8u161 RPM 용으로 업데이트 됨

wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.rpm

JDK 8u152 RPM 용으로 업데이트 됨

wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u152-b16/aa0333dd3019491ca4f6ddbe78cdb6d0/jdk-8u152-linux-x64.rpm

JDK 8u144 RPM 용으로 업데이트 됨

wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm

JDK 8u131 RPM 용으로 업데이트 됨

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

JDK 8u121 RPM 용으로 업데이트 됨

wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.rpm


나는 오라클이 자바 런타임과 자바 SDK를 가능한 한 어렵게 만들기 위해 모든 것을 가능하게 만들었다는 것을 알고 있습니다.

다음은 명령 줄 애호가를위한 몇 가지 가이드입니다.

데비안 유사 시스템의 경우 ( Debiansqueeze 및 Ubuntu12.x + 에서 테스트 됨 )

su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install --yes oracle-java7-installer
exit

참고 : 댓글을 추가하는 것이 더 좋거나 더 쉬운 방법을 알고 있다면 가이드를 업데이트하겠습니다.


Java SE 개발 키트 12.0.2

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.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz

최신 테스트,

wget --no-cookies --no-check-certificate --header "쿠키 : gpw_e24 = http % 3A % 2F % 2Fwww.oracle.com" " https://edelivery.oracle.com/otn-pub/java/ jdk / 7u25-b15 / jdk-7u25-linux-x64.tar.gz "

절대 보안에 관심이있는 경우 인증서 확인이 비활성화되어 있습니다. :)


Oracle은 Java를 사용하기위한 라이센스 계약에 Java를 사용하는 것만으로 라이센스에 '동의'한다고 명시되어 있지만 다운로드 링크에 방지 쿠키를 설정하여 조건에 동의하도록 강제했습니다.

오라클이 원하는 방법은 계약을 맺고 다운로드하는 것입니다. 그 후이 스크립트 cn은 특정 Linux에 맞게 수정됩니다.

#!/bin/bash
#Author: Yucca Nel http://thejarbar.org
#Will restart system
#Modify these variables as needed...
tempWork=/tmp/work
locBin=/usr/local/bin
javaUsrLib=/usr/lib/jvm

sudo mkdir -p $javaUsrLib
mkdir -p $tempWork
cd $tempWork

#Extract the download
tar -zxvf $downloadDir/jdk*tar.gz

#Move it to where it can be found...

sudo mv -f $tempWork/jdk* $javaUsrLib/

sudo ln -f -s $javaUsrLib/jdk1/bin/* /usr/bin/

#Update this line to reflect versions of JDK...
export JAVA_HOME="$javaUsrLib/jdk1.7.0_03"
#Extract the download
tar -zxvf $tempWork/*

#Move it to where it can be found...

sudo mv -f $tempWork/jdk1* $javaUsrLib/

sudo ln -f -s $javaUsrLib/jdk1*/bin/* /usr/bin/
sudo rm -rf $tempWork
#Update this line to reflect newer versions of JDK...
export JAVA_HOME="$javaUsrLib/jdk1.7.0_03"

if ! grep "JAVA_HOME=$javaUsrLib/jdk1.7.0_03" /etc/environment
then
    echo "JAVA_HOME=$javaUsrLib/jdk1.7.0_03"| sudo tee -a /etc/environment
fi


exit 0

JCE8이 필요한 경우에도 다운로드 할 수 있습니다.

curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip

또는

wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip

이것은 JDK 6에서 작동하며 다운로드 URL을 최신 버전으로 바꾸면됩니다.

wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk6-downloads-1637591.html;" http://download.oracle.com/otn-pub/java/jdk/6u33-b03/jdk-6u33-linux-x64.bin

모든 새 Java 버전에 새 링크를 사용하거나 기존 스크립트를 변경하는 대신 필요한 Java 패키지의 다운로드를 자동화하고 .NET을 통해 나중에 설치하는보다 일반적인 방법을 찾고있었습니다 yum localinstall ${JAVA_ENVIRONMENT}-${JAVA_VERSION}-linux-x64.rpm.

수동 / 사용자 작업과 유사한 사소한 접근 방식을 사용하여 패키지를 찾고 다운로드했습니다. 나는 확신 하나가 같은 다른 도구를 사용하여 그것을 할 수있는 더 우아한 방법을 찾을 것 또한 오전 egrep, awk그래서, 등등을 여기 예로두고 :

#!/bin/bash

### Proxy settings
# If there is a company proxy 

PROXY="my.proxy.local:8080"
PROXY_TYPE="--proxy-ntlm" # or leave empty with ""
USER="user"
PASS='pass'

### Find out the links to JRE and JDK 
# To do so, got to the page http://www.oracle.com/technetwork/java/javase/downloads/

BASE_URL="technetwork/java/javase/downloads"

# Put the whole page into a single string/line

BASE_URL_OUTPUT="$(curl -s -k ${PROXY_TYPE} -x "http://${USER}:${PASS}@${PROXY}" -L0 http://www.oracle.com/${BASE_URL}/)"

# Define the environments to download 

JAVA_ENVIRONMENTS=("JRE" "JDK") # ! yet "SERVER-JRE"

for JAVA_ENVIRONMENT in "${JAVA_ENVIRONMENTS[@]}"
do

echo
echo "JAVA_ENVIRONMENT="$JAVA_ENVIRONMENT
echo

for (( JAVA_BASE_VERSION = 8; JAVA_BASE_VERSION <= 10; JAVA_BASE_VERSION += 2 ))  
do

echo "JAVA_BASE_VERSION="$JAVA_BASE_VERSION

### "Read the page"
# and follow the links for the package interested in 

DOWNLOAD_SITE="$(echo $BASE_URL_OUTPUT | grep -m 1 -io "${JAVA_ENVIRONMENT}${JAVA_BASE_VERSION}-downloads-[0-9]*.html" -- | tail -1)"
echo "DOWNLOAD_SITE="$DOWNLOAD_SITE

### Gather the necessary download links
# To do so, following the link to the download site
# reading and accept the license 
# 
# ... the greedy regular expression is to address the different syntax of the links
# and already prepared for OR .gz files 

DOWNLOAD_LINK_OUTPUT="$(curl -s -k ${PROXY_TYPE} -x "http://${USER}:${PASS}@${PROXY}" -L -j -H "Cookie: oraclelicense=accept-securebackup-cookie" http://www.oracle.com/${BASE_URL}/${DOWNLOAD_SITE} |  grep -io "filepath.*${JAVA_ENVIRONMENT}-[${JAVA_BASE_VERSION}].*linux[-_]x64[._].*\(rpm\)" -- | cut -d '"' -f 3 | tail -1)"

# and echo out the link

echo "DOWNLOAD_LINK_OUTPUT="$DOWNLOAD_LINK_OUTPUT

done

done

Since the download links are available now, one may proceed further with wget or curl.


this command can download jdk8 tgz package at now (2018-09-06), good luck !

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/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.tar.gz"

All of the above seem to assume you know the URL for the latest Java RPM...

Oracle provide persistent links to the latest updates of each Java version as documented at https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=397248601136938&id=1414485.1 - though you need to create/log in to an Oracle Support account. *Otherwise you can only access the last "public" update of each Java version, e.g. 1.6_u45 (Mar 2013; Latest update is u65, Oct 2013)*

Once you know the persistent link, you should be able to resolve it to the real download; The following works for me, though I don't yet know if the "aru" reference changes.

ME=<myOracleID>
PW=<myOraclePW>
PATCH_FILE=p13079846_17000_Linux-x86-64.zip

echo "Get real URL from the persistent link"

wget -o getrealurl.out --no-cookies --no-check-certificate --user=$ME \
--password=$PW --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" \
https://updates.oracle.com/Orion/Services/download/$PATCH_FILE?aru=16884382&\
patch_file=$PATCH_FILE

wait    # wget appears to go into background, so "wait" waits 
        # until all background processes complete

REALURL=`grep "^--" getrealurl.out |tail -1 |sed -e 's/.*http/http/'`
wget -O $PATCH_FILE $REALURL
#These last steps must be done quickly, as the REALURL seems to have a short-lived 
#cookie on it and I've had no success with  --keep-session-cookies etc.

As already posted here: https://stackoverflow.com/a/41718895/4370196

Update for JDK 8 Update 121

Since Oracle inserted some md5hash in their download links, one cannot automatically assemble a download link for command line.

So I tinkered some nasty bash command line to get the latest jdk download link, download it and directly install via rpm. For all who are interested:

wget -q http://www.oracle.com/technetwork/java/javase/downloads/index.html -O ./index.html && grep -Eoi ']+>' index.html | grep -Eoi '/technetwork/java/javase/downloads/jdk8-downloads-[0-9]+.html' | (head -n 1) | awk '{print "http://www.oracle.com"$1}' | xargs wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" -O index.html -q && grep -Eoi '"filepath":"[^"]+jdk-8u[0-9]+-linux-x64.rpm"' index.html | grep -Eoi 'http:[^"]+' | xargs wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" -q -O ./jdk8.rpm && sudo rpm -i ./jdk8.rpm

The bold part should be replaced by the package of your liking.


I solve this (for Debian based Linux distros) by making packages using java-package a few times (for various architectures), then distributing them internally.

The big plus side is that this method always works; no matter how crazy Oracle's web pages become. Oracle can no longer break my build!

The downside is that it's a bit more work to set up initially.

  • Download the tar.gz files manually in a browser (thus "accepting" their terms)
  • Run make-jpkg jdk-7u51-linux-x64.tar.gz. This creates oracle-java8-jdk_8_amd64.deb
  • Distribute it within your organization

For distribution over the Internet, I suggest using a password protected apt repository or provide raw packages using symmetric encryption:

passphrase="Hard to crack string. Use /dev/urandom for inspiration."
gpg --batch --symmetric --force-mdc --passphrase-fd 0 \
   oracle-java8-jdk_8_amd64.deb <<< "$passphrase"

Of course providing (unencrypted) .deb packages on the internet is probably a violation of your license agreement with Oracle, which states:

... Oracle grants you a ... license ... to reproduce and use internally the Software complete and unmodified for the sole purpose of running Programs"

On the receiving end, if you have a password protected apt repo, all you need to do is apt-get install it. If you have raw packages, download, decrypt and dpkg -i them. Works like a charm!


I've made a jdk-download script (specific for the tar.gz) for my gentoo boxes. Doesn't need to be updated like other similar scripts, trying to "brute-force" download the latest build for whatever version you want.

USAGE

jdk-download< <version> <platform> [<build>]

* <version> - Something like "8u40"
* <platform> - Usually i586 or x64
* <build> - The internal build number used by oracle, to avoid guessing and trying to download starting from 99 to 1 (build 0, really?!!)

Blog post

Source on bitbucket


wget This Worked for me JDK8

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2F%www.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm"

The accepted answer was not working for me, as of 2017-04-25. However, the simple solution was using the -b flag instead of the --header option.

For example, to get jdk-1.8_131:

version='8u131'; wget -H -O jdk-$version-linux-x64.tar.gz --no-check-certificate --no-cookies -b "oraclelicense=a" http://download.oracle.com/otn-pub/java/jdk/$version-b11/jdk-$version-linux-x64.tar.gz

That will execute in the background, writing output to wget-log.


Try

wget --no-cookies --header "Cookie: s_nr=1359635827494; s_cc=true; gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk6downloads-1902814.html; s_sq=%5B%5BB%5D%5D; gpv_p24=no%20value" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64-rpm.bin --no-check-certificate -O ./jdk-6u45-linux-x64-rpm.bin

if you are like me trying to get Oracle JDK 6.

source: Oracle JVM download using curl/wget


oracle-java-download is a project on GitHub that allows you to create download links for JDK 8 and JDK 9 which you can use for further processing e.g in automated build or deployment processes.

It requires Linux, Docker and a JDK >= 8 to run.


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/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.rpm?AuthParam=1516282527_40effcfefd78d78bce12c0a4030a1b05"


Context

I recently faced the same problem and although the comments on this page and some others provided helpful hints - I thought it would be good to document the steps I took to fix the problem for folks who may be in need of further help.

System Details

I am following the PNDA set up on AWS by following the step by step pnda installation guide at:

https://github.com/pndaproject/pnda-guide/blob/develop/provisioning/aws/PREPARE.md

I am using ubuntu 14.04 [free tier eligible] on AWS cloud, and am running the code from 64 bit windows8.1 laptop. I am using PUTTY to connect to the server instance. I git cloned the pnda code from https://github.com/pndaproject/pnda to the ubuntu instance.

Important Note Please note that if you plan to use Ubuntu instance on AWS make sure it's 14.04 only. If you use version 16, it does not work. I learnt it the hard way!

Resolution Steps

As those who have gone as far as to have encountered the error being discussed here would know - the mirror creation file involves the following steps -

1) Run the script create_mirror.sh [ sudo su -s ./create_mirror.sh ] to run the full mirror creation process

2) This script in turn calls various other scripts - one of them being create_mirror_misc.sh; this script refers to pnda-static-file-dependencies.txt which has a list of files to be downloaded.

3) On the very first line of the pnda-static-file-dependencies.txt is a reference to download the jdk-8u131-linux-x64.tar.gz file from http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz oraclelicense=accept-securebackup-cookie; It is at this point that my script was failing with the message Failed to download http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz after 3 retries

4) I browsed to the page http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz and found the following error message displayed **In order to download products from Oracle Technology Network you must agree to the OTN license terms**

5) To resolve this problem I made the following change to the pnda-static-file-dependencies.txt; I added --no-check-certificate --no-cookies to bypass the license term agreement condition

6) So the revised code looks like - http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz --no-check-certificate --no-cookies oraclelicense=accept-securebackup-cookie

I hope this is helpful.


you should try:

wget \
        --no-cookies \
        --header "Cookie: oraclelicense=accept-securebackup-cookie" \
        http://download.oracle.com/otn-pub/java/jdk/8u172-b11/a58eab1ec242421181065cdc37240b08/jdk-8u172-linux-x64.tar.gz \
        -O java.tar.gz

download jdk 8u221

$ wget -c --content-disposition "https://javadl.oracle.com/webapps/download/AutoDL?BundleId=239835_230deb18db3e4014bb8e3e8324f81b43"
$ old=$(ls -hat | grep jre | head -n1)
$ mv $old $(echo $old | awk -F"?" '{print $1}')

my blog 044-wget下载jdk8u221


sudo wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.rpm"

Why not click to download from your browser then copy & paste the exact link where it was downloaded, for example:

wget http://download.oracle.com/otn-pub/java/jdk/7u40-b43/jdk-7u40-linux-x64.tar.gz?AuthParam=1380225131_dd70d2038c57a4729d8c0226684xxxx

You can find out the link by looking at the network tab of your browser after accepting terms in oracle and clicking to download. F12 in Chrome. Firebug in Firefox.

참고URL : https://stackoverflow.com/questions/10268583/downloading-java-jdk-on-linux-via-wget-is-shown-license-page-instead

반응형