This should resolve the issue on your system. Zsh (/bin/zsh): Edit the ~/.zshenv file and append the below code.~/.zshenv export JAVA_HOME=$(/usr/libexec/java_home) Bash (/bin/bash): Edit the ~/.bash_profile file and append the below code.~/.bash_profile export JAVA_HOME=$(/usr/libexec/java_home) Now, set the JAVA_HOME environment variable based on the active shell: Open a terminal and type:įor Zsh the output will be /bin/zsh and for the Bash shell the output will be /bin/bash. So first is to identify the shell that is running on your system. The macOS 10.5 (Catalina) and later version use the Zsh as the default shell. Use the below steps to resolve this issue. So the simple solution is to set it correctly. The Solution: #Īs the error message clearly shows that the JAVA_HOME environment variable is not set on my PC. When I tried to check the Maven version on our macOS PC, I got the following error in the output.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |