Install Java 14 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew

This environment

Install AdoptOpenJDK 14

Install by referring to the official materials. GitHub - AdoptOpenJDK/homebrew-openjdk: AdoptOpenJDK HomeBrew Tap

$ brew tap AdoptOpenJDK/openjdk
$ brew cask install adoptopenjdk14

Check the location of the installed directory with the java_home command

$ /usr/libexec/java_home -v 14

Set the environment variables JAVA_HOME and PATH

Describe it in ~ / .bashrc or ~ / .zshrc as needed.

$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home

Check the installed AdoptOpenJDK

$ java -version
openjdk version "14" 2020-03-17
OpenJDK Runtime Environment AdoptOpenJDK (build 14+36)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 14+36, mixed mode, sharing)

$ javac -version
javac 14

$ which java

$ which javac

$ ls /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home/bin/
jaotc		javap		jfr		jmap		jstack		rmiregistry
jar		jcmd		jhsdb		jmod		jstat		serialver
jarsigner	jconsole	jimage		jpackage	jstatd
java		jdb		jinfo		jps		keytool
javac		jdeprscan	jjs		jrunscript	rmic
javadoc		jdeps		jlink		jshell		rmid

Reference material

Recommended Posts

Install Java 11 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Java 14 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Java 8 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Java 8 (OpenJDK: Amazon Corretto) on macOS with Homebrew
Install Java 8 (OpenJDK: Zulu Community) on macOS with Homebrew
[Java development environment construction] Install OpenJDK 11 (Java 11) on macOS with Homebrew.
Install java with Homebrew
Install OpenJDK on macOS
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Java 7 with Homebrew (cask)
Install Java with zip on Windows
Install OpenJDK (Java) on the latest Ubuntu
Install Java8 with Yum on Amazon Linux
Install java and android-sdk on Mac using homebrew
Install Java on Mac
Install Java with Ansible
Install OpenJDK8 with RPM
Easily switch Java versions with alias on macOS
Install openjdk11 on mac
Install Homebrew on Ubuntu 20.04
Install OpenJDK 8 on mac
Install Ruby 3.0.0-preview1 on macOS (also without Homebrew ruby-build)
Java version control on macOS
Install Java on WSL Ubuntu 18.04
Install Rails on macOS Catalina
Install java 1.8.0 on Amazon linux2
Install openjdk8 on Docker image (Debian)
Install Ruby on MSYS2 with pacman
Install java with Ubuntu 16.04 based Docker
Install Java and Tomcat with Ansible
Install Java Open JDK 8 on CentOS 7
Install and configure jenv on macOS
Install ruby on Ubuntu 20.04 with rbenv
Install Java 9 on windows 10 and CentOS 7
Install Java development environment on Mac
How to install Adopt OpenJDK on Debian, Ubuntu with apt (-get)
Install imagick on macOS Catalina + php 7.4 Note
Using JupyterLab + Java with WSL on Windows 10
Install Docker Desktop for Mac with Homebrew
Java version control with jenv on OSX
Build OpenCV with Java Wrapper on Ubuntu 18.04
Install NextCloud on CentOS 7 with Alibaba Cloud ECS
Note Book: OpenCV with CUDA Install On Windows10
Install GitLab on CentOS 8 with no internet connection
Install Java, Apache, Tomcat9 on EC2 (Amazon Linux2)
Switch versions with alternatives after yum install java
Introducing Eclipse IoT-Part2: Install Eclipse Neon.2 on macOS Sierra
Downgrade Java MacOS
Using Java 8 with Bluemix (on Liberty Runtime & DevOps Service)
Build Java development environment with VS Code on Mac
Java development environment construction on Mac-JDK Install (2020 preservation version)
Install java and maven using brew on new mac
Display characters on I2C 1602 LCD with Raspberry Pi 3 & Java
Install rbenv with apt on ubuntu and put ruby
I struggled with pip install on an M1 Mac
Correspondence when Java application exed by launch4j does not work on windows with openJDK installed