How to automate downloading and installing Java JDK on Linux TODAY?

Here's a great answer on how to automate loading Java JDKs on Linux: Downloading Java JDKs on Linux via wget is shown on the license page

The described method no longer works. It seems that Oracle has again changed the limits on its boot servers to block this method. I suppose they don’t want Java to be used in server auto-scaling systems like AWS. What are they thinking?

The specific command I'm trying to download is to download the latest version of 7u51 to the AWS server so that I can install my web applications:

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

This does not apply to the OTN license agreement anymore, as indicated in this closed answer: https://stackoverflow.com/a/2123125/ ...

Trying this from my browser, I see that the download link adds additional authentication to the request parameter:

http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm?AuthParam=1392853518_cb83fe47e04500eecccdb66722756fb3

Copying and pasting this link using AuthParam in a call wgetdoes not work either. My initial hunch is that it is tied to a session or IP address.

It is not recommended to upload this manually to the server (or hundreds of servers a hundred times a day), so I hope for a workaround that will work with current limitations.

So TODAY, is there a way around the download of the latest JDK? Or should I just completely abandon Oracle?

+3
source share
3 answers

Your team works great for me. Check below:

$ ls jdk*
ls: cannot access jdk*: No such file or directory

$ wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2%2Fwww.oracle.com%2F" "http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm"
--2014-02-20 14:03:49--  http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm
Resolving download.oracle.com... 23.11.235.25, 23.11.235.43
Connecting to download.oracle.com|23.11.235.25|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm [following]
--2014-02-20 14:03:50--  https://edelivery.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm
Resolving edelivery.oracle.com... 23.35.70.140
Connecting to edelivery.oracle.com|23.35.70.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/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm?AuthParam=1392885351_97435f8939e97d11f6065b4147ddbae9 [following]
--2014-02-20 14:03:50--  http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm?AuthParam=1392885351_97435f8939e97d11f6065b4147ddbae9
Reusing existing connection to download.oracle.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 121271382 (116M) [application/x-redhat-package-manager]
Saving to: `jdk-7u51-linux-i586.rpm'

100%[=================================================================================================================================>] 12,12,71,382  381K/s   in 4m 14s  

2014-02-20 14:08:04 (466 KB/s) - `jdk-7u51-linux-i586.rpm' saved [121271382/121271382]


$ ls -l jdk*
-rw-r--r-- 1 root root 121271382 2014-02-11 00:10 jdk-7u51-linux-i586.rpm

? , .

0

Oracle , .

2014:

Java JDK Linux wget

+1

Java, .

: - CentOS

gedit abc

// bash abc script, [#!/bin/bash rpm -ivh jdk-8u31-linux-x64.rpm] abc.

#!/Bin/bash

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

chmod + xr jdk-8u31-linux-x64.rpm

rpm -ivh jdk-8u31-linux-x64.rpm

//

grant permission to execute abc file [chmod + xr abc]

run the file. / abc

+1
source

All Articles