homebrewjava-11jenvadoptopenjdk

How to upgrade AdoptOpenJDK8 and Java11 with Homebrew


I have searched a little bit, but im a little bit confused.

I have installed Java8 and Java11 by homebrew. Java8 is installed with adoptopenjdk/openjdk tap and Java11 is from homebrew/cask tap. When i see the version for AdoptOpenJDK i see this version:

openjdk version "1.8.0_212" OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_212-b03) OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.212-b03, mixed mode) but on Oracle i see that the build number is 33, and i have b03. How to update the version with homebrew?

When i switch to Java11 by using Jenv and get version on terminal i get: openjdk version "11.0.2" 2019-01-15 OpenJDK Runtime Environment 18.9 (build 11.0.2+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

On oracle i see that the version is 11.0.3, how to update this? Or cant i do that by homebrew? Or is it any other better solutions to install java and switch between versions?

Thank for all answers!


Solution

  • At least the Java 11 version is not available. Here is how to check

    1. Update brew brew update
    2. Search for java casks brew search java
    3. See info for java11 cask brew cask info java11
    $ brew cask info java11
    java11: 11.0.2,9
    https://www.oracle.com/technetwork/java/javase/
    Not installed
    From: https://github.com/Homebrew/homebrew-cask-versions/blob/master/Casks/java11.rb
    ==> Name
    OpenJDK Java Development Kit
    ==> Artifacts
    jdk-11.0.2.jdk -> /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk (Generic Artifact)
    

    Do the same for your Java 8 version. If a newer version is available upgrade your package with brew cask upgrade java11