First install openjdk with brew.
I typically use Nix, but for this setup to work the cacerts bundle must be mutable, which is (for good reason) not supported in Nix. There is a relevant discussion here that I have not had time to look into.
brew install openjdk@23