0

I am very new to Mac Terminal and struggling to remove JAVA_HOME variable from ~/.zshrc. I am using MacOS 10.15.7.

I used the following to install and set Java:

% brew cask install liberica-jdk8-full
% export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
% echo 'export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)' | tee >> ~/.zshrc

I then uninstalled Java, but I keep getting the following when I open Terminal:

Unable to find any JVMs matching version "1.8".
No Java runtime present, try --request to install.
Unable to find any JVMs matching version "1.8".
No Java runtime present, try --request to install.

I tried to use "Unset JAVA_HOME" command but it doesn't seem to work. Any suggestions how I can remove this variable from the environment?

Thanks in advance.

1 Answer 1

0

You may want to remove the corresponding line in your zshrc?

1
  • Thank you so much! I couldn't find the zshrc file in my Mac OS. But after your response, I searched for threads on "missing zshrc" and managed to create one. I then deleted the redundant lines and now it all works fine! Thanks again!
    – Capri2020
    Commented Jan 31, 2021 at 12:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .