1
1

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 1 year has passed since last update.

M1 Mac Java

Last updated at Posted at 2022-03-13

M1 Macにjavaをインストールした際の備忘録
個人的にM1 Macを購入したのでJDKをインストールするためのメモを残す。

参考リンク
https://qiita.com/kinoshitaken123/items/66c631099b4c8f98b3bf

JDK

JDK17から商用でも使えるそうなのでOracle版を使ってみようと思う。

java --version
tar xzvf openjdk-17.0.2_macos-aarch64_bin.tar.gz
ls -ll
sudo mv jdk-17.0.2.jdk /Library/Java/JavaVirtualMachines
java --version
openjdk 17.0.2 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)

JDK11(arm64)も欲しかったのでazulのサイトからダウンロード

スクリーンショット 2022-03-13 13.12.57.png

Eclipse

https://www.eclipse.org/downloads/packages/
Arch64をダウンロード
スクリーンショット 2022-03-13 13.04.42.png

JDKの切り替え方法

## インストール済みのJava一覧
/usr/libexec/java_home -V
## 環境変数設定
## JDK11に設定した例
export JAVA_HOME=`/usr/libexec/java_home -v "11"`
PATH=$JAVA_HOME/bin:$PATH
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?