Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see brew installed java with java -version command?

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

like image 382
Chris Garsonn Avatar asked Feb 26 '26 19:02

Chris Garsonn


1 Answers

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
like image 103
fn control option Avatar answered Feb 28 '26 09:02

fn control option



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!