DEV Community

kaede
kaede

Posted on

3 3

Clojure Tutorial Part 0 -- 環境構築 clojure tools と Temurin を入れる。

前提

M1 Mac

macOS Monterey ver 12.4

で brew で内部にインストールする。


arm64 の brew で clojure/tools/clojure をインストール

https://clojure.org/guides/install_clojure

clojure 公式のドキュメントを参考にする

brew --version
Homebrew 3.2.16
Enter fullscreen mode Exit fullscreen mode

まず brew が入っているかチェック

arch -arm64 brew install clojure/tools/clojure
Enter fullscreen mode Exit fullscreen mode

arm64 明記で clojure tools をインストールする。

この時点で clj コマンドが使えたかどうかは未検証。


java 17 のために cask で Temurin 17 を入れる。

https://qiita.com/tearoom6/items/1abf24ca6d872e6579b0#brew-tap

tap は非公式の brew ツールをインストールするコマンドらしい。

https://eng.shibuya24.info/entry/homebrew-cask

cask は GUI アプリを brew で入れるためのツールらしい。

brew tap homebrew/cask-versions
...
Resolving deltas: 100% (170387/170387), done.
Tapped 219 casks (249 files, 70MB).
Enter fullscreen mode Exit fullscreen mode

これで cask を使えるようにして

brew install --cask temurin17
...
==> Installing Cask temurin17

installer: Package name is Eclipse Temurin
installer: Installing at base path /
installer: The install was successful.
🍺  temurin17 was successfully installed!
Enter fullscreen mode Exit fullscreen mode

temurin の 17 がインストールされた。

java --version
openjdk 17.0.3 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)
Enter fullscreen mode Exit fullscreen mode

java のバージョンを見てみる。
ちゃんとさっき入れた Temurin 17 で入っている。
Java も 17 になっている。

JAVA_HOME は表示できないのが少し不安。


clojure のバージョンを確認

clj --version 
Clojure CLI version 1.11.1.1113
Enter fullscreen mode Exit fullscreen mode

clj または clojure コマンドで
Clojure CLI の 1.11 が入っていることを確認できた。

Clojure の環境構築はとりあえず終わったと解釈する


まとめ

M1 Mac で Clojure を入れるためには

arm64 brew で clojure/tools/clojure を入れて

brew (cask) で Temurin 17 を入れる。

すると java 17 が入って clojure コマンドが使えるようになる。

Top comments (0)

Great read:

Is it Time to go Back to the Monolith?

History repeats itself. Everything old is new again and I’ve been around long enough to see ideas discarded, rediscovered and return triumphantly to overtake the fad. In recent years SQL has made a tremendous comeback from the dead. We love relational databases all over again. I think the Monolith will have its space odyssey moment again. Microservices and serverless are trends pushed by the cloud vendors, designed to sell us more cloud computing resources.

Microservices make very little sense financially for most use cases. Yes, they can ramp down. But when they scale up, they pay the costs in dividends. The increased observability costs alone line the pockets of the “big cloud” vendors.

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay