Install Maven 3.0.5 on RedHat Linux

Can someone help me install maven 3.0.5 on linux?

I tried using the wget , yum and tar commands. All teams say that they do not recognize him as an external or internal team, and now I'm empty about how to achieve it. Do I need to go to start->cmd and apply these commands?

And also please tell me how to set the environment variable. Please help me.

Thanks in advance.

+7
linux maven tar wget yum
source share
3 answers

The first thing we need to do is download the tar Maven file and deploy it to a common location on the workstation.

 wget http://mirrors.gigenet.com/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz su -c "tar -zxvf apache-maven-3.0.5-bin.tar.gz -C /opt/" 

Set the Maven environment variables to the shared profile. The next step is to configure the Maven environment variables in the general profile so that all users on the system receive imports during login.

 su -c "vi /etc/profile.d/maven.sh" # Add the following lines to maven.sh export M2_HOME=/opt/apache-maven-3.0.5 export M2=$M2_HOME/bin PATH=$M2:$PATH 

Now test your Maven installation. Log out and then log in. Enter the following command:

 [ jsmith@regan ~]$ mvn -version 

If you did everything correctly, your result should look something like this:

 Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500) Maven home: /opt/apache-maven-3.0.5 Java version: 1.7.0_19, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-358.2.1.el6.i686", arch: "i386", family: "unix" 
+33
source share

Note: execute commands without quotes

The above link will not work, it has been damaged. If you want to get the latest versions, please find the link below "Wget http://mirror.olnevhost.net/pub/apache/maven/binaries/apache-maven-3.0.5-bin.tar.gz "

Steps:

  • Downlaod fileat / opt / Maven / apache-maven-3.0.5-bin.tar.gz
  • Extract the file in the same place "tar xvf apache-maven-3.0.5-bin.tar.gz" and run it.
  • Open "vi / etc / profile"
  • Insert the following line:

    export M2_HOME = / opt / Maven / apache-maven-3.0.5

    export PATH = $ PATH: $ M2_HOME / bin

  • Save the file.

  • Run "source / etc / profile"
  • Finally run "mvn -version" and you will get the maven version

Made installation of Maven.

+3
source share
 echo $JAVA_HOME if returns empty(export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home) echo $PATH if returns empty(export PATH=$PATH:$JAVA_HOME/bin) export M2_HOME=/usr/local/apache-maven/apache-maven-3.2.3 export M2=$M2_HOME/bin mvn --version ALL SET ******* In case if this doesn't work after this step, vi .profile export PATH={$PATH}:'/usr/local/apache-maven/apache-maven-3.2.3/bin/ 
0
source share

All Articles