.zshenv:3: bad assignment

I am getting that bad assignment thing on my terminal can anyone help me with that please?attached is the picture

MacBook Air, macOS 14.5

Posted on Jun 29, 2024 3:46 PM

Reply
Question marked as Top-ranking reply

Posted on Jun 29, 2024 4:16 PM

It was whitespace around the =


If you are still using Java, here is a two-line corrected file:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/home
export PATH=$JAVA_HOME/bin:$PATH


I’d usually use different syntax here for zsh PATH processing, but this parallels what you have.


If not using Java, the contents of that file can be removed, or the file can be entirely deleted.

5 replies
Question marked as Top-ranking reply

Jun 29, 2024 4:16 PM in response to nooruddin195

It was whitespace around the =


If you are still using Java, here is a two-line corrected file:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/home
export PATH=$JAVA_HOME/bin:$PATH


I’d usually use different syntax here for zsh PATH processing, but this parallels what you have.


If not using Java, the contents of that file can be removed, or the file can be entirely deleted.

Jun 29, 2024 3:51 PM in response to nooruddin195

nooruddin195 wrote:

I am getting that bad assignment thing on my terminal can anyone help me with that please?


The third line of ~/.zshenv contains a syntax error.


Probably an alias command, and possibly erroneous whitespace around the =


You can use cat ~/.zshenv and check that file, and then use pico or (from the GUI) BBEdit (free and paid, and free is enough) to edit and correct the contents.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

.zshenv:3: bad assignment

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.