Sdkman-cli: Cannot install Java 7u79 -- SHA-256 does not match

Created on 23 May 2017  路  12Comments  路  Source: sdkman/sdkman-cli

sdkman is failing to install Java 7u79:

> sdk install java 7u79

Oracle requires that you agree with the Oracle Binary Code License Agreement
prior to installation. The license agreement can be found at:

  http://www.oracle.com/technetwork/java/javase/terms/license/index.html

Do you agree to the terms of this agreement? (Y/n): Y


Downloading: java 7u79

In progress...

######################################################################## 100.0%
SHA-256 does not match! Please try re-installing.
Expected: b52bcac56440e7fd0b5db9e331d31d2bd458f588b8b01e52eaf0ad2affaf9da2
Actual  : d97f0f402bd65a9c26aa266246b0894c8d6762e82373377641ca779c46406299
exit

Note that it also exits out of my terminal session, so that was a slight nuisance.

The resulting file in ~/.sdkman/tmp is actually an HTML file downloaded from oracle.com that is a 404 error page.

I think Oracle now requires logging in via an Oracle account in order to download older JDK packages. So perhaps you could prompt for the Oracle account credentials and then download the file.

All 12 comments

As a total hacky workaround, I downloaded the JDK 7u79 from Oracle's website, then I opened up ~/.sdkman/tmp/hook_post_java_7u79.sh and just above line 5, the line starting with "__sdkman_validate_input_binary", I added:

cp "/Users/carter/Downloads/jdk-7u79-macosx-x64.dmg" "$binary_input"

Obviously point to your own downloads directory. Then I removed write permission from this shell script, to make sure sdkman didn't undo the change (chmod -x ~/.sdkman/tmp/hook_post_java_7u79.sh).

This will cause sdkman to still download that 404 page, however then it runs the post script, which will now copy the real dmg file into the expected place, and installation can proceed.

I ran sdk install java 7u79 again, and this time it succeeded.

I'm having the same issue. The odd thing is that JDK 6u65 downloaded and installed just fine for me.

Thanks for the suggested workaround.

@Ricket yes, it seems like oracle have enabled an account login for JDK 7, but not on any other JDK versions(!). For all Java versions up to this point we have relied on dropping a cookie (on pre install hook) when the user agrees to the OBCLA. Subsequently, the post install hook picks up the cookie and performs the download. This no longer works 7u79.

It seems inevitable that we will be dropping Oracle JDKs very soon in favour of the Zulu JDKs, which are a pure OpenJDK implementation.

Unfortunately I will have to remove 7u79 from the database for now until we have Zulu in place.

@bigdaz I've also tried installing 6u65 through a Vagrant OSX Sierra, but it seems to hang for me. What version of OSX are you on?

On further investigation, they have also removed all Java 8 versions prior to 8u131. I've removed them out of the database too.

I'm guessing the database has been updated already, so this means we can no longer use this hack?

No, but you can add it as a Local Version to be manged by sdkman.

@marc0der FYI: I've just posted a question to SE with regards to Oracle JDK redistribution.

If you check the JDK 7 readme and the Oracle Binary Code License Agreement, you will find that you can only redistribute the JRE and specific parts of the JDK, and only for the purpose of running Java software. So sdkman is entirely unable to redistribute Java, even just the JRE.

@shyiko @Ricket Just to be very clear, _we do not redistribute the JDK_. All binaries are hosted by Oracle on their website. We merely provide a convenient tool that facilitates the installation of their binaries on your local environment.

This is why we have a problem installing certain versions of Oracle JDK at the moment: they are no longer accessible on their site.

@marc0der sure, this was purely FYI. jabba does not redistribute anything either and so we are affected in the same way.

I've just written an article which clearly explains our stance on proprietary vs open source JDKs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WizardMerlin picture WizardMerlin  路  3Comments

OmidTahouri picture OmidTahouri  路  7Comments

ilopmar picture ilopmar  路  5Comments

Omnipresent picture Omnipresent  路  6Comments

hho picture hho  路  4Comments