[JAVA] Install openjdk11 on mac

Introduction

openJDK11 has been released. I hurriedly installed it on my mac, so I will summarize the procedure.

environment

1. Download openJDK

Download openJDK for MacOS from the following URL. http://jdk.java.net/11/

I downloaded it from the link in the red frame below. スクリーンショット 2018-09-26 23.22.08.png

2. Extract the download file

Extract the downloaded tar.gz.

$ tar xvzf openjdk-11+28_osx-x64_bin.tar.gz

3. Move the extraction folder

Move the extracted and created folder under "/ Library / Java / JavaVirtualMachines /".

$ sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines/

4. Confirm with Java_home command

Check if it is recognized by the Java_home command.

$ /usr/libexec/java_home  -V
Matching Java Virtual Machines (3):
    11, x86_64:	"OpenJDK 11"	/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
    1.6.0_65-b14-468, x86_64:	"Java SE 6"	/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
                                                ︙

Confirm that "OpenJDK 11" is displayed.

5. Register in environment variable

Register in the environment variable.

export JAVA_HOME=`/usr/libexec/java_home -v 11`

6. Version check

Check the version, and if openJDK is specified, you're done.

$ java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

Recommended Posts

Install openjdk11 on mac
Install OpenJDK 8 on mac
Install gradle on mac
Install OpenJDK on macOS
Install Java on Mac
Install tomcat + eclipse on mac
Install Java development environment on Mac
How to install Eclipse (Photon) on Mac
I can't install rails on my mac
Run STS4 on Mac
Install java and android-sdk on Mac using homebrew
Install Golang on CentOS 8
Install pyqt5 on ubuntu
Install Neo4j 4.1.3 on centOS
Install Java 11 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Vertica 10.0 on CentOS 6.10
Install Ruby / Rails on Mac M1 Big Sur 2021-01
Install Java 14 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Mac Rails Install Error
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install SonarQube on Mac and challenge source analysis
Install Python 3 on CentOS 7
Install Java 8 (OpenJDK: AdoptOpenJDK) on macOS with Homebrew
Install Autoware on Ubuntu 18.04.5
OpenJDK installation on CentOS 7
Install Mattermost on CentOS 7
Install PostGIS 2.5.5 on CentOS7
Install Homebrew on Ubuntu 20.04
Install Redmine 4.1.1 on CentOS 7
Smokeping Install on CentOS7
Install PostgreSQL 13 on CentOS 7.5
[Ruby] I can't install puma on Mac [Rails, etc.]
Install Java 8 (OpenJDK: Amazon Corretto) on macOS with Homebrew
Install java and maven using brew on new mac
Install Eclipse on Mac and translate it into Japanese
Install Java 8 (OpenJDK: Zulu Community) on macOS with Homebrew
I struggled with pip install on an M1 Mac
Install ag (the silver searcher) [on CentOS / Ubuntu / Mac]
Install Docker on Raspberry Pi
Install Docker on Windows 10 PRO
Install Docker on Ubuntu Server 20.04
Install Sidekiq pro on Rails
Install rbenv on Amazon Linux
Install zabbix agent (5.0) on Ubuntu 18.04
Manually build OpenJDK on Windows
Install tomcat on Sakura's VPS
Install OpenFOAM v2006 on CentOS
Install Arudino IDE on Ubuntu 20
Install Jenkins on Docker's CentOS
Install Ubuntu Desktop 20.10 on RaspberryPi4
Install Apache on CentOS on VirtualBox
Install Rails on macOS Catalina
Install raspi-config on Ubuntu 20.04 (LTS)
Install Ruby 2.7 on RHEL 8 (AppStream)
Install docker on AWS EC2
Install WordPress 5.5 on Ubuntu 20.04 LTS
Install Ruby 2.7 on CentOS 7 (SCL)
Try Spring Boot on Mac
Install Ubuntu Server 20.04 on Btrfs
Note: Install PostgreSQL 9.5 on Ubuntu 18.04