Method for configuring Maven projects

1. Java environment variables are configured File location: /Users/lucax/.bash_profile

< blockquote>

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/

CLASSPAHT=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/ tools.jar

PATH=$JAVA_HOME/bin:$PATH:

export JAVA_HOME

export CLASSPATH

export PATH

source ~/.bash_profile (reset variable file, I won’t say much about this, the terminal must execute this sentence after configuring environment variables)

It’s ok if the terminal enters java and javac and responds
Reference https://www.jianshu.com/p/fe6b68295479
2. Configure maven environment
Download the maven package address: http://maven.apache.org/download.cgi (the binary zip file)
Unzip the configuration environment variables

< div class="image-package">

export M2_HOME=”your local maven path”

export PATH=”$M2_HOME/bin:$PATH”

Enter source ~/.bash_profile Make environment variables take effect.

Enter mvn -v to see if Maven is installed successfully.

Share a picture

Reference: https://blog .csdn.net/PT1993/article/details/85601270

(There is a pit here, I don’t know why, you have to close the terminal again, and then Open one, enter the command to succeed)

JAVA_HOME=/ Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/

CLASSPAHT=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

< p>PATH=$JAVA_HOME/bin:$PATH:

export JAVA_HOME

export CLASSPATH

export PATH

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk /Contents/Home/

CLASSPAHT=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

PATH=$JAVA_HOME/bin:$PATH:

export JAVA_HOME

export CLASSPATH

export PATH

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/

CLASSPAHT=.:$JAVA_HOME /lib/dt.jar:$JAVA_HOME/lib/tools.jar

PATH=$JAVA_HOME/bin:$PATH:

export JAVA_HOME

export CLASSPATH

export PATH

source ~/.bash_profile (Reset the variable file, this is not much to say, the terminal must be executed when the environment variable is configured This sentence)

Terminal input java and javac are ok if it responds
Reference https://www.jianshu.com/p/fe6b68295479
2. Configure the maven environment
Download the maven package address: http://maven.apache. org/download.cgi (Binary zip file)
Unzip configuration environment variables

export M2_HOME= “you The local maven path of “

export PATH=”$M2_HOME/bin:$PATH”

Enter source ~/.bash_profile to make the environment variable take effect.

Enter mvn -v to see if Maven is installed successfully.

Share a picture

Reference: https://blog .csdn.net/PT1993/article/details/85601270

(There is a pit here, I don’t know why, you have to close the terminal again, and then Open one and enter the command to succeed)

< span class="s1">source ~/.bash_profile (Reset the variable file, this is not much to say, the terminal must execute this sentence when the environment variable is configured)

The terminal enters java and javac and it is ok if it responds
Reference https://www .jianshu.com/p/fe6b68295479
2. Configure the maven environment
Download the maven package address: http://maven.apache.org/download.cgi (the binary zip file)

< div class="image-package"> Unzip configuration environment variables

export M2_HOME=”Your local maven path”

export PATH= “$M2_HOME/bin:$PATH”

Enter source ~/.bash_profile to make the environment variable effective.

Enter mvn -v to see if Maven is installed successfully.

Share a picture

Reference: https://blog .csdn.net/PT1993/article/details/85601270

(There is a pit here, I don’t know why, you have to close the terminal again, and then Open one, enter the command to succeed)

source ~/.bash_profile (re Set the variable file, this is not much to say, the terminal must execute this sentence when the environment variable is configured)

terminal Enter java and javac and it will be ok

Reference https://www.jianshu.com/p/fe6b68295479

2. Configure the maven environment

Download the maven package address: http://maven.apache.org/download.cgi (the binary zip file)

Unzip the configuration environment variables

export M2_HOME=”your local maven path”

export PATH=”$M2_HOME/bin:$PATH”

Enter source ~/ .bash_profile Make environment variables take effect.

Enter mvn -v to see if Maven is installed successfully.

Share a picture

Reference: https://blog .csdn.net/PT1993/article/details/85601270

(There is a pit here, I don’t know why, you have to close the terminal again, and then Open one, enter the command to succeed)