When installing Apache Maven, first of all, check whether Java 1.x JDK is installed in your machine. If not make sure to install Java JDK, not JRE.
Note: To have an understanding about JDK, JRE and JVM, follow this.
1. Download Apache Maven
After installing Java JDK, you are now eligible to install Maven. Go to Apache Maven Official Site and download any version you need. For this example, I use Apache Maven version 3.0.5
In your terminal,
$ wget http://mirror.reverse.net/pub/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
$ sudo tar xzf apache-maven-3.0.5-bin.tar.gz -C /usr/local
$ cd /usr/local
$ sudo ln -s apache-maven-3.0.5 maven
2. Setting up the Maven Path system-wide
In your terminal again,
$ sudo vi /etc/profile.d/maven.sh
export M2_HOME=/usr/local/apache-maven-3.0.5 export PATH=${M2_HOME}/bin:${PATH}Now we are done with installing Apache.
Note: It is essential to restart the machine to activate above environmental variables.
3. To Verify Whether Maven Is Installed
In your terminal,
Comments
Post a Comment