Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find any JVMs matching version "1.8.0_40" when open terminal on macOS

  • I have installed jdk1.8.0_121 already and JAVA_HOME seems correct. But when I open terminal, it always reminds me "Unable to find any JVMs matching version "1.8.0_40"". enter image description here

  • jdk1.8.0_40 was installed Previously but I hava already uninstalled this version.

Does anyone know how to remove this annoying reminder? Thanks a lot.

like image 505
Brooklyn Knightley Avatar asked Feb 02 '17 02:02

Brooklyn Knightley


3 Answers

i solved this using this command in terminal

brew install --cask homebrew/cask-versions/adoptopenjdk8
like image 66
SYED FAISAL Avatar answered Oct 07 '22 08:10

SYED FAISAL


MacOS X does not come with Java Development Kits (JDKs) pre-installed. Run java -version in the terminal and you may be prompted to install Java. Unless you already have JVM installed, in which case you will see the build version number.

Next, you will be prompted to visit the Java SE Development Kit Downloads page. Download one of the JDK (Java Development Kits) with a file extension ending in <filename>.tar.gz.

Then run tar -xf <filename>.tar.gz.

Rename the newly created directory to JAVA_HOME.

like image 12
amsloa Avatar answered Oct 07 '22 08:10

amsloa


@sideshowbarker, you're right. I checked all shell initialization files and found the java version was set as 1.8.0_40 in /etc/profile. Thanks again.

like image 1
Brooklyn Knightley Avatar answered Oct 07 '22 09:10

Brooklyn Knightley