Configure MAVEN environment variable configuration under MAC

Configuration of MAVEN environment variables:

Step 1: Download MAVEN from MAVEN's official website. http://maven.apache.org/download.cgi, what I downloaded here is apache-maven-3.39-bin.tar.gz
Step 2: Decompress the downloaded tar package, I decompress it to: /Users/calvin/Documents/tools/apache-maven-3.3.9.
Step 3: Configure environment variables.
  1. After using su to be a super administrator, use the command cd ~ to enter the configuration environment variable directory.
  2. If there is no .bash_profile file in the directory, we use the touch command to create it. For example, touch .bash_profile. Created
  3. Then we enter into .bash_profile. Use the vim command sh-3.2# vin .bash_profile
  4. After entering .bash_profile, configure the environment:
	MAVEN_HOME:指向我们的maven目标
		
	PATH:执行我们的maven 二进制执行文件的路径
		
	MAVEN_HOME="/Users/daixiaorong/Documents/tools/apache-maven-3.3.9"
		
	PATH=$PATH:$MAVEN_HOME/bin
  1. After configuration, use the source command to take effect
    source .bash_profile
  2. We can check whether the installation is successful through the following command.

(1) Use the echo command to print the path

	echo $MAVEN_HOME

(2) Use the mvn -v command to query the version of maven

Guess you like

Origin blog.csdn.net/heqiushuang110/article/details/127058185