-1

I am new to macOS. I know this question has been asked a lot before but all mentioned methods are not work for me. I have tried https://www.youtube.com/watch?v=_gdpclEE-kA one also but it displayed an error like no such file or directory.(java version 16.0.1)

thash97
  • 21
  • 1

2 Answers2

0

Add

 export JAVA_HOME=`/usr/libexec/java_home`

(backticks) in .bashrc file

0

The default shell for macOS has changed to zsh so you would need to edit either ~/.zshrc. So, you can do something like this:

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

This should work if you have jdk installed

Saad Parwaiz
  • 131
  • 1
  • 4