2

I have installed java open jdk latest version with homebrew with the following command:

brew install openjdk

I try to to check installed versions with the command

/usr/libexec/java_home -V

Nothing showing.

And the command java -version also showing :

No Java runtime present, requesting install

Where is my java ? How can I see installed version and use it and see it with java -version command

Chris Garsonn
  • 717
  • 2
  • 18
  • 32

1 Answers1

6

I recommend installing the JDK cask temurin instead:

brew uninstall openjdk
brew install temurin

Otherwise, you must symlink the openjdk formula into /Library/Java/JavaVirtualMachines:

sudo ln -sfn $(brew --prefix openjdk)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
fn control option
  • 1,745
  • 6
  • 18