5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Java 11 (OpenJDK: Eclipse Temurin) を Homebrew で macOS にインストールする

Posted at

概要

  • AdoptOpenJDK の後継である Eclipse Temurin を Homebrew で macOS にインストールする。

Good-bye AdoptOpenJDK. Hello Adoptium! | AdoptOpenJDK Blog

The move from AdoptOpenJDK to Eclipse Adoptium is now complete. The same great community that brought you high quality Java binaries for the last four years at AdoptOpenJDK is now fully productive at Adoptium.

Adoptium Celebrates First Release | Adoptium Blog

This first release of Temurin from the Adoptium community and covers the latest versions of Java SE 8, Java SE 11, and Java SE 16 on each of Linux, Windows, and macOS on Intel 64-bit processors, with more platforms to follow shortly.

今回の環境

  • macOS Big Sur 11.4

インストール

インストール方法は Eclipse Temurin の前身である AdoptOpenJDK の公式資料を参考にする。

GitHub - AdoptOpenJDK/homebrew-openjdk: AdoptOpenJDK HomeBrew Tap

$ brew tap homebrew/cask-versions
$ brew install --cask temurin11

java_home コマンドでインストールされたディレクトリの場所を確認

$ /usr/libexec/java_home -v 11
/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home

環境変数 JAVA_HOME と PATH を設定

必要に応じて .zprofile や .zshrc などに記述する。

$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home
$ PATH=${JAVA_HOME}/bin:${PATH}

インストールされた Eclipse Temurin を確認

$ java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7)
OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode)

$ javac -version
javac 11.0.12

$ which java
/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin/java

$ which javac
/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin/javac

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

参考資料

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?