One. The first is to install Maven:
Steps:
1. Download Maven Tar Package
http://maven.apache.org/download.cgi
2. Unzip to a folder after downloading
[HTML] View plaincopy on code to see a snippet derived from my Code slice
/users/xuchen/desktop/dev/applications/maven/apache-maven-3.2.1
3. Creating environment variables
CD to root path, CD ~
New file
[HTML] View plaincopy on code to see a snippet derived from my Code slice
VI. bash_profile
Modify
[Plain] View plaincopy on code to see a snippet derived from my Code slice
maven_home=/users/xuchen/desktop/dev/applications/maven/apache-maven-3.2.1
Path= p a t h : Maven_home/bin
Export Maven_home
Export PATH
4. Make the configuration file effective
[HTML] View plaincopy on code to see a snippet derived from my Code slice
source. bash_profile
5. See if MAVEN is installed successfully
Mvn-version command
However, I have an error here:
Exception in thread "main" java.lang.unsupportedclassversionerror:org/apache/maven/cli/mavencli:unsupported Major.minor version 51.0
Reason: This version of Maven is written with jdk1.7, my Java environment is 1.8, so no!
WORKAROUND: Change the Java environment back to 1.7
Specifically refer to this article:
Http://hdu104.com/23
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Mac installs Maven and modifies Java environment variables