-1

I had a Java 19 VM installed with homebrew, but it seems it was installed as openjdk not openjdk@19. Another brew install (ffmeg seeing as you ask) decided to upgrade openjdk, which upgraded my 19 to 20.

Now I cannot find anywhere to download a version 19 JVM, and Gradle will not build with Java 20 ;-(

$ brew list ... openjdk openjdk@17 ... $ brew install openjdk@19 Warning: openjdk 19.0.2 is already installed and up-to-date. To reinstall 19.0.2, run: brew reinstall openjdk 

https://www.oracle.com/uk/java/technologies/downloads/ has only versions 17 and 20 to download.

14
  • 3
    Why not fix the underlying problem: why does the code you are trying to compile not compile with Java 20? Oracle is very careful with keeping Java backwards compatible, so if your code does not compile with 20 then there is likely something strange in your code. Commented May 15, 2023 at 11:52
  • 2
    If you really cannot fix the real problem, then you can find 19 in the archive. Commented May 15, 2023 at 11:53
  • 3
    OpenJDK 19 is already end of life. It was one of the short-lived versions. You are supposed to move on to the next version, or stay in one of the long term version like JDK 11 or 17. Commented May 15, 2023 at 11:53
  • 4
    I appologize for the unnecessary snark, but your problem is a direct result of using a JDK which is explicitly not supported for a long time. It's unfortunate that the Gradle support windows don't align usefully with the Java support windows, but the fact that Java 19 is (and was always known to be!) supported only for a very short time makes problems like this much more likely when depending on it. What I'm trying to say: within my snark there was also a kernel of a suggestion to use this as a useful lesson: LTS versions exist for a reason. Commented May 15, 2023 at 13:13
  • 2
    Agreed, that's why I treat the non-LTS releases as "playthings". It's annoying, but since the LTS releases are roughly as far apart as real releases were pre-Java-9, it means the cadence of "releases I can fully upgrade to" has stayed very consistent throughout the last decade. Commented May 15, 2023 at 15:49

1 Answer 1

2

https://jdk.java.net/ leads to https://jdk.java.net/19/ which has tar.gz downloads available.

Once the file is downloaded and expanded, the JVM it can be moved into the place that things seem to expect it with eg

sudo mv jdk-19.0.2.jdk /Library/Java/JavaVirtualMachines/ 

@Jesper points out a larger archive https://www.oracle.com/uk/java/technologies/downloads/archive/

There are script-friendly URLs and checksums available for many releases and architectures - https://www.oracle.com/java/technologies/jdk-script-friendly-urls/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.