No suitable Java Virtual Machine could be found on your system on Mac

1.9k Views Asked by At

I'm trying to open "knowage.sh" with terminal on Mac, but I have this problem:

  • No suitable Java Virtual Machine could be found on your system. The version of the JVM must be at least 1.8 and at most 1.8. Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

I have installed idk 1.8 and I set up JAVA_HOME. How can I fix?

1

There are 1 best solutions below

0
On

Set INSTALL4J_JAVA_HOME on MAC like JAVA_HOME in .zshrc libe below

$  sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

$  echo 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc

$  echo 'export PATH="/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home/bin:$PATH"' >> ~/.zshrc

$  echo 'export JAVA_HOME=$(/usr/libexec/java_home)' >> ~/.zshrc

$  echo 'export INSTALL4J_JAVA_HOME=$(/usr/libexec/java_home)' >> ~/.zshrc

$  source ~/.zshrc