homebrew-cask-versions: Java8 not working anymore
General troubleshooting steps
- I have retried my command with
--force. - I ran
brew update-reset && brew updateand retried my command. - I ran
brew doctor, fixed as many issues as possible and retried my command. - I have checked the instructions for reporting bugs.
- I made doubly sure this is not a checksum does not match error.
- I checked there are no open issues for the same problem.
- I understand that if I ignore these instructions, my issue may be closed without review.
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)
Links to this issue
Commits related to this issue
- Update to available version of JDK8 https://github.com/Homebrew/homebrew-cask-versions/issues/7253 — committed to Crissman/malmo by Crissman 5 years ago
- Move to AdoptOpenJDK8 The java8 cask has been removed. See Homebrew/homebrew-cask-versions#7253. — committed to jalaziz/macos by jalaziz 5 years ago
- Update reference to Java8 Java8 cask has been deleted. See discussion at https://github.com/Homebrew/homebrew-cask-versions/issues/7253 — committed to ashishb/dotfiles by ashishb 5 years ago
- Update reference to Java8 (#14) Java8 cask has been deleted. See discussion at https://github.com/Homebrew/homebrew-cask-versions/issues/7253 — committed to ashishb/dotfiles by ashishb 5 years ago
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.
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.
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
Next edit
java8.rbfile (usually in/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions/Casks/)Change the following lines:
versionto:version '8u212,b10:59066701cf1a433da9770636fbc4c9aa'sha256to:sha256 '9bcb4265a55e2fe63b9c58ca6c5a54eb6dda303bb69510ca6eddc2f088e41b2a'urlto:url "http://localhost:8000/jdk-#{version.before_comma}-macosx-x64.dmg",pkgto: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
Truer words have never been spoken. 👌
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:
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
java8cask, ask the user to install Oracle JDK 8 manually and offer one freebrew cask installable alternative.After looking into the issue, I suggest to apply the following fixes, most critical listed first:
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
java8cask.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.Add the third-party OpenJDK 1.8 we’ve chosen to
homebrew-cask-versions. (Name the cask something other thanjava8so existing installs of Oracle JDK 8 will be preserved.)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.
Delete the
java8cask 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.
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.
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.
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.
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.
Last time we checked, we found more than 70 formulas in homebrew-core which would not even work with OpenJDK 9+.
I agree. Right now I’m looking into @imranzahid01’s findings and how they may help save the
java8cask 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.
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.
The https://medium.com/@javachampions/java-is-still-free-2-0-0-6b9aa8d6d244 is a vendor-neutral doc explaining the options.
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).