Can't install oracle jdk on CentOS machine using wget

I want to install Oracle java JDK 8 on CentOS I cannot install java jdk because when I try to install java jdk using command

[root@ADARSH-PROD1 ~]# 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/8u131-b27/jdk-8u131-linux-x64.rpm"

      

I am getting output:

Connecting to edelivery.oracle.com 
(edelivery.oracle.com)|23.211.196.232|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u131-b27/jdk-8u131-    linux-x64.rpm?AuthParam=1495864027_230ebffd10615c26528e8d2496500338 [following]
--2017-05-27 11:15:07--  http://download.oracle.com/otn-pub/java/jdk/8u131-    b27/jdk-8u131-linux-x64.rpm?    AuthParam=1495864027_230ebffd10615c26528e8d2496500338
Connecting to download.oracle.com (download.oracle.com)|184.25.109.32|:80...     connected.
HTTP request sent, awaiting response... 404 Not Found
2017-05-27 11:15:09 ERROR 404: Not Found.

      

+4


source to share


3 answers


Oracle has updated its link generation mechanism. It now includes some sequence that appears to be constant for the version, but generated by an as yet unknown mechanism. Also, downloading any version except latest

now requires an Oracle account:

For production use, Oracle recommends downloading the latest JDK and JRE versions and the ability to automatically upgrade.

Only developers and enterprise administrators should download these releases.

An oracle.com account is required to download these editions. if you do not have an oracle.com account, you can use the links at the top of this page to learn more about it and register for free.

Read more on the Oracle Java Archives page .

So you're stuck with two options now.

Option 1. Use the latest version ( 8u131

now) from the new direct link. The link is available on the Java SE Development Kit 8 download page after the license agreement is accepted. And your command will be:



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/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm"

      

Option 2. Switch to package openjdk

:

yum install java-1.8.0-openjdk

      

Read more about installing openjdk on OpenJDK: Download and Install page .

+5


source


I had the same problem as OP for jdk-8u131 and after checking the Option 1 command in the answer above mine, I noticed it was exactly the same. I cut out the paste that's the Option 1 answer and it worked! So, I then repeated my initial call a few times (which is exactly the same) and it failed several times with the same message, and then around the 5th or 6th move it worked ... so I think that when you are using the last url that it works fine with option 1, but you may see a 404 error more than once - if that is so just wait and then try again.



+1


source


Things like this happen repeatedly. The main problem is that Oracle wants you to read and agree to the license terms.

This is a legal thing. If you can implement a scheme in which you can automate uploads without the intervention of a person clicking the I Agree button, chances are that some judges may decide that the terms of the agreement do not apply to you.

So Oracle is trying to make it harder (or at least ... not easy) to automate the download of "free" versions of Java. And from time to time they change mechanisms.

Several ways to deal with this:

  1. Ask Oracle if they will give you access to a stable download site (presumably password-controlled) if you paid for the license. (I really don't know if they do.)

  2. Manually download the distribution for each version of Java you need and store them in a safe private place 1 . Then change your auto-deployment code to download distributions from that location.

  3. Switch to third-party OpenJDK provider; for example a Linux package source or one of the vendors that make OpenJDK binaries available for free and unlimited downloads.

I know all of the above entails some effort. But there is a "fuss" of scripted downloads from " http://download.oracle.com " every time an unrecognized change occurs.


1 - 1) Check with your lawyers first. I think that the license allows this, but IANAL. 2) Do not deliberately or accidentally publish them, or you are liable to be on the wrong end of a copyright violation lawsuit!

0


source







All Articles