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

## 参考

### 初期設定

https://qiita.com/ucan-lab/items/c1a12c20c878d6fb1e21

https://jp.easeus.com/mac-data-recovery/recover-and-show-hidden-files-on-mac.html

https://mameshibaweb.com/clipy/

### homebrew

https://www.teamxeppet.com/macbook-m1-homebrew-install/

### anyenv / nodenv

https://hacknote.jp/archives/58512/

https://north-shiho.hatenablog.com/entry/2019/07/16/093522

https://qiita.com/rinpa/items/81766cd6a7b23dea9f3c#github%E3%81%AE%E3%82%BD%E3%83%BC%E3%82%B9%E3%81%8B%E3%82%89%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB

### yarn

nodenvある前提

```
npm install -g yarn
nodenv rehash
```

https://qiita.com/ClapAndWhistle/items/a5ac200501454e064abb

### VSCode

https://totonote.com/2021/01/19/initial-setup-for-macbook-air-m1/#toc14

### git

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

https://qiita.com/shiho_hoshino/items/af50acbf4b77a7545708

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

https://marketplace.visualstudio.com/items?itemName=mhutchie.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://qiita.com/kanican0813/items/c7bb016e353461c8a0df

https://kiyosan.life/2020/12/01/azul-java-m1-macbookpro13/

https://zenn.dev/osuzuki/articles/b41dc7be15e2b5

https://www.publickey1.jp/blog/20/applemacjavaazul.html
![スクリーンショット 2021-08-21 22.40.46.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/645692/5653e308-8bcc-c49d-fac4-f928c3a5612f.png)

### Gradle

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

```
brew install gradle@6
```