When I try to download Java from Oracle I instead end up downloading a page telling me that I need agree to the OTN license terms.
Sorry!
In order to download products from Oracle Technology Network you must agree to the OTN license terms.
Be sure that...
- Your browser has "cookies" and JavaScript enabled.
- You clicked on "Accept License" for the product you wish to download.
- You attempt the download within 30 minutes of accepting the license.
How can I download and install Java?
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:
That will execute in the background, writing output to
wget-log
.Updated for JDK 8u171 RPM
Outdated links below
Updated for JDK 8u161 RPMUpdated for JDK 8u152 RPM
Updated for JDK 8u144 RPM
Updated for JDK 8u131 RPM
Updated for JDK 8u121 RPM
wget This Worked for me JDK8
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:
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 process2) 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 messageFailed 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 condition6) 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.
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.