M1 MBP に変更してから kSar 使ってなかったので、必要になったこのタイミングでインストール……と思ったらまず Java がなかった。
brew 経由で openjdk をインストールする。
❯ brew install java Running `brew update --auto-update`... ==> Auto-updated Homebrew! Updated 4 taps (homebrew/core, homebrew/cask, homebrew/bundle and mongodb/brew). ==> New Formulae soplex utftex You have 20 outdated formulae and 2 outdated casks installed. You can upgrade them with brew upgrade or list them with brew outdated. ==> Fetching dependencies for openjdk: libx11 ==> Fetching libx11 ==> Downloading https://ghcr.io/v2/homebrew/core/libx11/manifests/1.8.4 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/libx11/blobs/sha256:e6df4fc6bb84dd64a2f2c68d474c415de2a0fa0aac85ff4e650a56c0d739463e ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:e6df4fc6bb84dd64a2f2c68d474c415de2a0fa0aac85ff4e650a56c0d739463e?se=2023-02-06T06%3A ######################################################################## 100.0% ==> Fetching openjdk ==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/manifests/19.0.2 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/blobs/sha256:c576dc5ee012c98010595cecfd9373050e9a48000291201c9f057cb0fa7eaf43 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:c576dc5ee012c98010595cecfd9373050e9a48000291201c9f057cb0fa7eaf43?se=2023-02-06T06%3A ######################################################################## 100.0% ==> Installing dependencies for openjdk: libx11 ==> Installing openjdk dependency: libx11 ==> Pouring libx11--1.8.4.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/libx11/1.8.4: 1,054 files, 7MB ==> Installing openjdk ==> Pouring openjdk--19.0.2.arm64_ventura.bottle.tar.gz ==> Caveats For the system Java wrappers to find this JDK, symlink it with sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk openjdk is keg-only, which means it was not symlinked into /opt/homebrew, because macOS provides similar software and installing this software in parallel can cause all kinds of trouble. If you need to have openjdk first in your PATH, run: echo 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc For compilers to find openjdk you may need to set: export CPPFLAGS="-I/opt/homebrew/opt/openjdk/include" ==> Summary 🍺 /opt/homebrew/Cellar/openjdk/19.0.2: 637 files, 320.0MB ==> Running `brew cleanup openjdk`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). ==> Caveats ==> openjdk For the system Java wrappers to find this JDK, symlink it with sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk openjdk is keg-only, which means it was not symlinked into /opt/homebrew, because macOS provides similar software and installing this software in parallel can cause all kinds of trouble. If you need to have openjdk first in your PATH, run: echo 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc For compilers to find openjdk you may need to set: export CPPFLAGS="-I/opt/homebrew/opt/openjdk/include"
インストールしたら即認識されると思ってたんだけど、なんかおかしいな? と思ってメッセージよく見たらシンボリックリンク追加しろ、って書いてあった。
❯ sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk Password: ❯ java -version openjdk version "19.0.2" 2023-01-17 OpenJDK Runtime Environment Homebrew (build 19.0.2) OpenJDK 64-Bit Server VM Homebrew (build 19.0.2, mixed mode, sharing)
一番最初に参照される java が、今回インストールした openjdk である必要があるなら、以下のようにパスの追加をして対応する。
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
あとで jenv いれるか? みたいな気持ちなので、この作業は一旦パス。
kSar
結局起動しなかった。まあ対応してないかなー、という気持ちはある。