homebrew-cask-versions: Java8 not working anymore

General troubleshooting steps

Description of issue

Oracle Java is no longer available for public download (license change). The last fix (https://github.com/Homebrew/homebrew-cask-versions/pull/6934) does not work anymore.

Edit: License changed at April 16, 2019 - see https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html for details

Command that failed

brew cask install java8

Output of command with --force --verbose --debug

curl: (22) The requested URL returned error: 404 Not Found
Error: Download failed on Cask 'java8' with message: Download failed: https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-macosx-x64.dmg

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 13
  • Comments: 23 (16 by maintainers)

Commits related to this issue

Most upvoted comments

My preference would be to nuke Java out of existence and from everyone’s collective memory. It’s truly the language from hell, and its overlords are finicky. Never has a (collection of) cask(s) given us so many headaches, and they’re the most popular. It’s like a sick joke. Java is the tenth circle that Dante deemed too terrifying to write about.

Even though we don’t want to endorse any specific distribution

It’s worth noting that over the two next comments, it was argued that the OpenJDK builds are essentially the same (confirmed by Oracle) with different licenses. We use those for the after-8 Java casks, but they don’t provide a version for 8.

Mine is AdoptOpenJDK

I’m fine with that choice and the points above. I’m also fine with bringing back any and all AdoptOpenJDK cask you see fit for the cask-java effort.

The workaround is that you manually download the JDK from Oracle’s website https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html (you would need to register yourself to Oracle first and then sign on to download).

Once downloaded start a local HTTP Server for the file. I did the following on my Mac machine

cd ~/Downloads
python -m SimpleHTTPServer 8000

Next edit java8.rb file (usually in /usr⁩/⁨local/Homebrew⁩/Library⁩/Taps⁩/caskroom⁩/homebrew-versions⁩/Casks/)

Change the following lines: version to: version '8u212,b10:59066701cf1a433da9770636fbc4c9aa'sha256 to: sha256 '9bcb4265a55e2fe63b9c58ca6c5a54eb6dda303bb69510ca6eddc2f088e41b2a' url to: url "http://localhost:8000/jdk-#{version.before_comma}-macosx-x64.dmg", pkg to: pkg 'JDK 8 Update 212.pkg'

If you get a SHA-256 checksum error then you can verify the file you downloaded by running the command openssl dgst -sha256 ~/Downloads/jdk-8u212-macosx-x64.dmg. This will give you the checksum value which you can put above.

Run

brew cask install java8

My preference would be to nuke Java out of existence and from everyone’s collective memory. It’s truly the language from hell, and its overlords are finicky. Never has a (collection of) cask(s) given us so many headaches, and they’re the most popular. It’s like a sick joke. Java is the tenth circle that Dante deemed too terrifying to write about.

Truer words have never been spoken. 👌

AdoptOpenJDK

I’m also fine with that.

@micw As stated in https://github.com/Homebrew/homebrew-cask-versions/issues/7253#issuecomment-484494459, I’m currently finishing up a fix for the caveat directly in homebrew-core.

This is the current draft of what the caveat will say:

${FORMULA_NAME}: Java 1.8 is required to install this formula.

Download and install Java SE 8 from:
  https://www.oracle.com/technetwork/java/javase/downloads/index.html
Or install AdoptOpenJDK 8 with Homebrew Cask:
  brew cask install homebrew/cask-versions/adoptopenjdk8

I would recommend that you now fetch your Java from the AdoptOpenJDK cask: https://github.com/AdoptOpenJDK/homebrew-openjdk

tl;dr Let’s delete the java8 cask, ask the user to install Oracle JDK 8 manually and offer one free brew cask installable alternative.


After looking into the issue, I suggest to apply the following fixes, most critical listed first:

  1. Change the caveat for unmet Java 1.8 requirements in the core code. The new caveat should recommend manually downloading and installing Oracle’s JDK (from behind the registration wall) as a first choice. The caveat should also no longer mention the java8 cask.

  2. Discuss and pick at least one third-party OpenJDK 1.8 build (e. g. AdoptOpenJDK 8) that we’re comfortable to suggest to the user in the caveat. Even though we don’t want to endorse any specific distribution, we can’t assume that all Homebrew users are willing to deal with Oracle’s registration wall. That’s why the caveat should mention at least one third-party alternative that can be brew cask installed.

  3. Add the third-party OpenJDK 1.8 we’ve chosen to homebrew-cask-versions. (Name the cask something other than java8 so existing installs of Oracle JDK 8 will be preserved.)

  4. Back in the core code, mention the new cask in the caveat. The caveat should still present Oracle’s JDK as the preferred choice. This is because there are a few known differences between builds (pdf) (see page 5 of the PDF for details), and we’re certainly not going to check all > 70 affected core formulas for whether or not they play well with the third-party OpenJDK.

  5. Delete the java8 cask as @robertleeblairjr and others have suggested.

@Homebrew/cask maintainers: what are your opinions/preferred choices regarding step 2?

Mine is AdoptOpenJDK; it works just fine, and we already carry a few of their builds. AdoptOpenJDK has committed to supporting Java 8 until September 2023.

Also pinging @karianna, who knows a lot more about Java than I do.

I was just commenting to help save someone the headache of hosting the Oracle distribution, providing it through this cask, and then it being pulled because of it being unauthorized.

Thanks @robertleeblairjr. Your input helped establish that the cask needed to be abandoned. That’s much appreciated.

I apologize if my comment seemed overly nitpicky. Its purpose was to make extra sure I understand everything correctly before we proceed.

No worries. I didn’t take offense. I find this constant changing of Oracle’s licensing as annoying as many other people. Take care and have a nice day.

Oracle had forewarned that all of the older versions were EOL by the coming year and that 11+ were for subscribers.

However, I don’t remember Oracle ever announcing that they intended to put Oracle JDK 8 behind a registration wall any time before December 2020.

However, OpenJDK has stated that they would only provide support to include patches for 11+.

Just to avoid misunderstandings: that’s what Oracle said, not OpenJDK. A few companies other than Oracle keep maintaining, producing and supporting several OpenJDK variants well below 11.

OpenJDK is not patching versions prior to 11. […] their open source counterpart aren’t supporting versions older than 11, […] and OpenJDK are non-patched since their last support of it.

See above; several companies do offer free, public support for OpenJDK all the way down to OpenJDK 1.8.

Oracle also still maintains and patches their own (non-public) Java 8 fork, and still offers binary builds, which they call Oracle JDK 8 and which are subject to their license agreements.

I wouldn’t believe that the majority of the code being migrated to 11 is incompatible.

Last time we checked, we found more than 70 formulas in homebrew-core which would not even work with OpenJDK 9+.

Either way, this cask would have to reference a distribution which is public and authorized for distribution by a third party.

I agree. Right now I’m looking into @imranzahid01’s findings and how they may help save the java8 cask quickly. If that’s not feasible, we’re going to have to find a replacement.

User experience (getting some technical error message rather than a “please use openjdk8 or install java manually” message).

@claui The “solution” was to delete the cask? IMO that will break lot of stuff with unclear cause. Replacing it with something that prints a clear statement would probably have been the better way…

I guess we can close the issue now.

tl;dr Let’s delete the java8 cask, ask the user to install Oracle JDK 8 manually and offer one free brew cask installable alternative.

After looking into the issue, I suggest to apply the following fixes, most critical listed first:

  1. Change the caveat for unmet Java 1.8 requirements in the core code. The new caveat should recommend manually downloading and installing Oracle’s JDK (from behind the registration wall) as a first choice. The caveat should also no longer mention the java8 cask.

Please note that users will need to pay Oracle (behind a registration wall) if they want the latest Oracle Java 8 (which is at version 8u212). It is a valid choice but as mentioned below there are multiple OpenJDK providers providing a free OpenJDK 8 (which is at version 8u212 and contains the same patches as Oracle except for one which came in late). The https://medium.com/@javachampions/java-is-still-free-2-0-0-6b9aa8d6d244 is a vendor-neutral doc explaining the options.

  1. Discuss and pick at least one third-party OpenJDK 1.8 build (e. g. AdoptOpenJDK 8) that we’re comfortable to suggest to the user in the caveat. Even though we don’t want to endorse any specific distribution, we can’t assume that all Homebrew users are willing to deal with Oracle’s registration wall. That’s why the caveat should mention at least one third-party alternative that can be brew cask installed.

The https://medium.com/@javachampions/java-is-still-free-2-0-0-6b9aa8d6d244 is a vendor-neutral doc explaining the options.

  1. Add the third-party OpenJDK 1.8 we’ve chosen to homebrew-cask-versions. (Name the cask something other than java8 so existing installs of Oracle JDK 8 will be preserved.)
  2. Back in the core code, mention the new cask in the caveat. The caveat should still present Oracle’s JDK as the preferred choice. This is because there are a few known differences between builds (pdf) (see page 5 of the PDF for details), and we’re certainly not going to check all > 70 affected core formulas for whether or not they play well with the third-party OpenJDK.
  3. Delete the java8 cask as @robertleeblairjr and others have suggested.

@Homebrew/cask maintainers: what are your opinions/preferred choices regarding step 2?

Mine is AdoptOpenJDK; it works just fine, and we already carry a few of their builds. AdoptOpenJDK has committed to supporting Java 8 until September 2023.

Also pinging @karianna, who knows a lot more about Java than I do.

Hope I helped 😃, happy to keep answering questions

Unfortunately no regular user knows that workaround. I’d suggest to modify the script to display a “how-to-download” text and let the user put the binary on a certain location to continue (and fail unless the downloaded file is there).