I want to add apache maven to my path variable so I put export commands in ~/.zshrc file

echo "executing ~/.zshrc" 
#Setting-up  maven
export $M2_HOME="/Users/adelinghanayem/Downloads/apache-maven-3.8.6" 
export PATH

However, when I open a new terminal I get

/Users/adelinghanayem/.zshrc:5: /Users/adelinghanayem/Downloads/apache-maven-3.8.6 not found
  • 5
    Remove the $ from the export line: export M2_HOME=.... You use $ to get the value of a variable, never when setting the variable or its properties. Dec 10, 2022 at 8:01


You must log in to answer this question.

Browse other questions tagged .