Install java 17 on Mac using brew and setting up java_home
I tried this:
brew install java17
> Downloading https://formulae.brew.sh/api/formula.jws.json
100\.0%
> Downloading https://formulae.brew.sh/api/cask.jws.json
100\.0%
> Warning: No available formula with the name "java17". Did you mean javacc?
> Searching for similarly named formulae and casks...
> Error: Cask java6 exists in multiple taps:
homebrew/cask-versions/java6
> caskroom/versions/java6
Assuming brew is already installed and updated:
If using bash:
Or using zsh (on macOS Catalina or newer), then it should be:
Restart your shell.
If you have multiple JDK versions installed, you can specify one, using
-vflag:Check the java version: