M1 Mac 設定で参考にした資料まとめ


作った環境

  • Homebrew 3.2.8
  • anyenv 1.1.4
  • nodenv 1.4.0+3.631d0b6
  • jenv
  • Python 2.7.16
  • node 14.17.5
  • yarn 1.22.11
  • VS Code 1.60.0-insider
    • Git Graph
    • Extension Pack for Java v0.18.4
    • Spring Boot Extension Pack v0.1.0
  • Docker Desktop 3.6.0 (3.6.0.5487)
  • Gradle 6.9.1

参考

初期設定

homebrew

anyenv / nodenv

yarn

nodenvある前提

npm install -g yarn
nodenv rehash

VSCode

git

Sorce TreeはM1では使えないけどsshの管理は同じにした

Sorce Tree使えないのでVSCodeの拡張機能Git Graphを入れた

jenv と java

「macOS」の「ARM 64-bit」を選択 .dmgファイル

$ java -version // インストール後実行して確認
openjdk version "15.0.4" 2021-07-20
OpenJDK Runtime Environment Zulu15.34+17-CA (build 15.0.4+5-MTS)
OpenJDK 64-Bit Server VM Zulu15.34+17-CA (build 15.0.4+5-MTS, mixed mode)

$ /usr/libexec/java_home -V // パスの確認
Matching Java Virtual Machines (1):
    15.0.4 (arm64) "Azul Systems, Inc." - "Zulu 15.34.17" /Library/Java/JavaVirtualMachines/zulu-15.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/zulu-15.jdk/Contents/Home

$ anyenv install jenv // jenvでjavaバージョン管理 
/var/folders/8r/_kls_s59597f1p_mp51x4xnm0000gp/T/jenv.20210821224519.19632 ~
Cloning https://github.com/jenv/jenv.git master to jenv...
Cloning into 'jenv'...
remote: Enumerating objects: 1243, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 1243 (delta 14), reused 13 (delta 6), pack-reused 1215
Receiving objects: 100% (1243/1243), 448.39 KiB | 2.23 MiB/s, done.
Resolving deltas: 100% (572/572), done.
~

Install jenv succeeded!
Please reload your profile (exec $SHELL -l) or open a new session.

$ exec $SHELL -l
jenv has been updated, process to refresh plugin links

$ jenv add $(/usr/libexec/java_home) 
zulu64-15.0.4 added
15.0.4 added
15.0 added
15 added

$ jenv versions
* system (set by /Users/shiho_hoshino/.anyenv/envs/jenv/version)
  15
  15.0
  15.0.4
  zulu64-15.0.4

$ jenv global 15.0.4
$ jenv versions
  system
  15
  15.0
* 15.0.4 (set by /Users/shiho_hoshino/.anyenv/envs/jenv/version)
  zulu64-15.0.4

https://www.publickey1.jp/blog/20/applemacjavaazul.html

Gradle

最新じゃ動かない環境だったのでバージョン指定した

brew install gradle@6