[JAVA] Install OpenJDK on macOS

For OpenJDK 11.0.2

  1. Download from Archived OpenJDK General-Availability Releases.

    wget https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_osx-x64_bin.tar.gz
    
  2. Unzip the ╩╗openjdk-11.0.2_osx-x64_bin.tar.gz file to / Library / Java / JavaVirtualMachines / `.

    sudo tar zxvf openjdk-11.0.2_osx-x64_bin.tar.gz -C /Library/Java/JavaVirtualMachines/
    
  3. Change the owner / owning group of the file.

    sudo chown -R root:wheel /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk
    
  4. Make sure that ╩╗OpenJDK` is recognized.

    /usr/libexec/java_home -V
    
  5. Register the JAVA_HOME environment variable.

    export JAVA_HOME=`/usr/libexec/java_home -v 11.0.2`
    
  6. Execute the java command and check the operation.

    java -version
    
  7. Since macOS Catalina 10.15 uses zsh, change the ~ / .zprofile file.

    vi ~/.zprofile
    
    export JAVA_HOME=`/usr/libexec/java_home -v 11.0.2`
    

Recommended Posts

Install OpenJDK on macOS
Install openjdk11 on mac
Install OpenJDK 8 on mac
Install OpenJDK7 (JAVA) on ubuntu 14.04
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 Rails on macOS Catalina
Install Java 8 (OpenJDK: Amazon Corretto) on macOS with Homebrew
Install Java 8 (OpenJDK: Zulu Community) on macOS with Homebrew
Install openjdk8 on Docker image (Debian)
Install and configure jenv on macOS
[Java development environment construction] Install OpenJDK 11 (Java 11) on macOS with Homebrew.
Install imagick on macOS Catalina + php 7.4 Note
Install OpenJDK (Java) on the latest Ubuntu
Install gradle on mac
Install Corretto 8 on Windows
Install Java on Mac
Install Golang on CentOS 8
Install OpenJDK8 with RPM
Install pyqt5 on ubuntu
Install Neo4j 4.1.3 on centOS
Install Docker on Manjaro
Install Vertica 10.0 on CentOS 6.10
Install Ruby on Ubuntu 20.04
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install lombok on SpringToolSuite4
Install Python 3 on CentOS 7
Install kuromoji on CentOS7
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 jpndistrict on CentOS 7
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
Introducing Eclipse IoT-Part2: Install Eclipse Neon.2 on macOS Sierra
Install Ruby 3.0.0-preview1 on macOS (also without Homebrew ruby-build)
Java version control on macOS
Install Docker on Raspberry Pi
Install Cybozu Office 10 on Ubuntu 20.4
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
Install MAV Proxy 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 Java on WSL Ubuntu 18.04
Install Jenkins on Docker's CentOS
Install Ubuntu Desktop 20.10 on RaspberryPi4
Install Apache on CentOS on VirtualBox
Uninstall old JDK on macOS
Install Arduino IDE on Ubuntu 20.04
Install raspi-config on Ubuntu 20.04 (LTS)
Install Ruby 2.7 on RHEL 8 (AppStream)