1

I want to download and install Java. The command i used was:

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

However i end up getting the following error. How can i solve this ?

--2014-05-09 01:43:19--  http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz
Resolving download.oracle.com... 165.254.202.218, 165.254.202.210
Connecting to download.oracle.com|165.254.202.218|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz [following]
--2014-05-09 01:43:19--  https://edelivery.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz
Resolving edelivery.oracle.com... 23.6.118.140
Connecting to edelivery.oracle.com|23.6.118.140|:443... connected.
WARNING: certificate common name `www.oracle.com' doesn't match requested host name `edelivery.oracle.com'.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2014-05-09 01:43:19--  http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com|165.254.202.218|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: `download-fail-1505220.html'

100%[===========================================================================================================================================================================>] 5,307       --.-K/s   in 0s      

2014-05-09 01:43:19 (571 MB/s) - `download-fail-1505220.html' saved [5307/5307]
Illep
  • 16,375
  • 46
  • 171
  • 302
  • 2
    Oracle requires you accept a license agreement before you can download anything from them. This should help you: http://stackoverflow.com/questions/10268583/how-to-automate-download-and-installation-of-java-jdk-on-linux .. notice they added `"Cookie: oraclelicense=accept-securebackup-cookie"` – Gary Schreiner May 10 '14 at 04:50

1 Answers1

6

USe cookie -- oraclelicense=accept-securebackup-cookie

wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.tar.gz
ravi ranjan
  • 5,920
  • 2
  • 19
  • 18