Install Maven in Zsh on Mac

This post explains how to install Maven in a Zsh environment on Mac, including setup steps and configuration.

Mar 4, 2018 · 1 min read · 66 Words · -Views -Comments · Programming
Linux 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

Maven is a build tool for Java development. This post shows how to install it in a Zsh environment.

Download Maven

Unzip it and place it in a directory such as /Library/apache-maven-3.5.2.

Open terminal (e.g. iTerm2) and edit zshrc

$ vi ~/.zshrc

Append the following at the end of the file:

export M2_HOME=/Library/apache-maven-3.5.2
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

Exit the editor, close the terminal, and restart it.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover