To set up environment variables on your M1 MacBook, follow these steps:
Open Terminal on your Mac.
Type the following command to create a new file:
touch ~/.zshrc
Open the file in a text editor using the following command:
open ~/.zshrc
Add the environment variable(s) to the file in the following format:
export VARIABLENAME=variablevalue
For example:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home
Save the file and exit the text editor.
To apply the changes, run the following command in Terminal:
source ~/.zshrc
Now, to resolve the ZSH permission denied error, follow these steps:
Open Terminal on your Mac.
Type the following command:
sudo chmod u+x /usr/local/bin
Press Enter and enter your administrator password when prompted.
This command gives user execute permission on the /usr/local/bin directory where many of the user-installed binaries are located.
With these steps, you should be able to successfully set up environment variables on your M1 MacBook and resolve the ZSH permission denied error.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-08-15 11:00:00 +0000
Seen: 10 times
Last updated: Nov 08 '21
How can set the Project Title in the Doxygen Configuration File?
How can I convert Double to Long in Java?
Can I add a default Parameter for a Method in Java like int calculate(int x, int y=2)?
How can the rejection of the class text_plain from JavaMail API due to a VerifyError be confirmed?
Is it feasible to utilize a Toggle Button to switch among multiple classes exceeding 2?
What is the process for generating a dynamic subdomain/URL using vue.js?