[JAVA] Summary of JDK that can be installed with Homebrew (as of November 2019)

Introduction

There was a conflict between AdoptOpenJDK and Cask-Versions, and it is a JDK area that can be installed with homebrew, but it seems that it has been organized is.

Here, the JDK that can be installed by homebrew and its commands are summarized as a memorial (?).

At the time of this writing, the latest version is Java 13.

Homebrew

openjdk

brew install openjdk

The latest version of OpenJDK will be ** built and installed ** at hand.
However, since it is specified as keg-only, you need to put a symbolic link to the folder for $ JAVA_HOME after installation.

sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

.bashrc etc. (How to pass PATH)


#xx is the version of the JDK you have installed (eg:13)
export JAVA_HOME=`/usr/libexec/java_home -v xx`

It seems that you can build and install released versions after 11 with @version number.
(Of course, the support period is based on the release schedule)

# OpenJDK 11
brew install openjdk@11
# OpenJDK 12
brew install openjdk@12

Homebrew Cask

java

brew cask install java

The latest version of Oracle OpenJDK Build (https://jdk.java.net/) (OpenJDK built by Oracle) will be installed.

The difference from brew install java is

  1. The point that what Oracle built is downloaded as it is
  2. Since it is placed directly in the folder for $ JAVA_HOME, you only need to pass it through the PATH of JAVA_HOME
    (* Probably all the JDKs that can be installed with subsequent cask)

is.

(Reposting how to pass the PATH)


#xx is the version of the JDK you have installed (eg:13)
export JAVA_HOME=`/usr/libexec/java_home -v xx`

You can also install the next version of Early Access or Oracle Open JDK 11.

#Oracle OpenJDK Next Version Early Access Edition
brew cask install java-beta
# Oracle OpenJDK 11
brew cask install java11

Note That:

To download the Oracle Open JDK (https://jdk.java.net/), cask homepage value /java.rb#L7) is https://openjdk.java.net/, is it a setting error? I feel that it will.

java6

brew cask install java6

If you were wondering why 6 is next to 11 ... this is in the past JavaForOSX.dmg provided by Apple did.

oracle-jdk

brew cask install oracle-jdk

The latest version of the Oracle JDK (https://www.oracle.com/technetwork/java/javase/downloads/index.html) provided by Oracle will be installed.

Oracle JDK License is applied for use.

zulu

brew cask install zulu

The latest version of Zulu JDK provided by Azul, which is also used in Microsoft Azure, will be installed.

It seems that you can also install older versions of Zulu's own LTS with a version number.

# Azul Zulu JDK 11
brew cask install zulu11
# Azul Zulu JDK 8
brew cask install zulu8
# Azul Zulu JDK 7
brew cask install zulu7

adoptopenjdk

brew cask install adoptopenjdk

The latest version of OpenJDK built by AdoptOpenJDK.net Community will be installed.

By tapping AdoptOpenJDK / openjdk, you will be able to specify the version and install the J9 version in addition to the HotSpot VM version.

brew tap AdoptOpenJDK/openjdk
# AdoptOpenJDK,HotSpot version 11
brew cask install adoptopenjdk11
# AdoptOpenJDK,HotSpot version of JRE only
brew cask install adoptopenjdk11-jre
# AdoptOpenJDK,OpenJ9 version 11
adoptopenjdk11-openj9

See https://github.com/AdoptOpenJDK/homebrew-openjdk/tree/master/Casks for more.

corretto

brew cask install corretto

The latest version of Amazon Correto, which is also used for Amazon Linux, will be installed.

At the time of this writing, 11 and 8 have been released.

# Amazon Correto 11
brew cask install corretto
# Amazon Correto 8
brew cask install corretto8

sapmachine-jdk

brew cask install sapmachine-jdk

The latest version of OpenJDK (SapMachine) provided by SAP in Germany will be installed.

There seems to be no cask for LTS (11) (yet).

Which JDK should I install?

Summary related to OpenJDK Sommelier It is a good feeling to select (or build) a distributor that suits your environment according to the build source, license, and LTS provision status while watching.

If you want to use and switch between multiple JDKs, you should consider using SDKMAN! and JEnv.

Some distributors' JDKs can't be installed with Homebrew yet, so if you want one, commit to Homebrew Cask.

in conclusion

Can I install this too? Please let me know if you have any.

Recommended Posts

Summary of JDK that can be installed with Homebrew (as of November 2019)
Summary of css selectors that can be used with Nookogiri
Summary of ORM "uroboroSQL" that can be used in enterprise Java
Organize methods that can be used with StringUtils
[Ruby] Methods that can be used with strings
[Book Review] Unit testing of programming sites that can be done with zero experience
The world of Azure IoT that can be played on the DE10-Nano board: Ajuchika with FPGA !!?
List of devices that can be previewed in Swift UI
Create a page control that can be used with RecyclerView
Firebase-Realtime Database on Android that can be used with copy
Four-in-a-row with gravity that can be played on the console
[Book Review] Unit test of programming site that can be done with zero experience (sequel 1-JUnit ~)
SwiftUI View that can be used in combination with other frameworks
Introduction to Java that can be understood even with Krillin (Part 1)
This and that of the JDK
Set the access load that can be changed graphically with JMeter (Part 2)
Simple slot machine implementation that can be used with copy and paste
About the problem that the server can not be started with rails s
Set the access load that can be changed graphically with JMeter (Part 1)
[Rails] "pry-rails" that can be used when saving with the create method
Performance analysis and failure diagnostic tools that can be used with OpenJDK
Ruby array methods that can be used with Rails (other than each)