Maven (i) installation under Linux

Source: Internet
Author: User

1. Check if the JDK is installed, and set the environment variable (java_home):

Echo $JAVA _home

Java-version

Operation Result:

Displays the installation path of the JDK, and the Java version, such as:

#jdk路径

/usr/lib/jvm/jdk1.8.0_112

#java版本

Java Version "1.8.0_112"

Java (TM) SE Runtime Environment (build 1.8.0_112)

Java HotSpot (TM) 64-bit Server VM (build 25.112-b15, Mixed mode)

Note: If it is not installed, please install the JDK first (this is not explained in detail here)

2. Download and install

Download the MAVEN installation file to http://maven.apache.org/download.cgi , such as apache-maven-3.0-bin.tar.gz, then unzip to the local directory:

wget https://archive.apache.org/dist/maven/binaries/apache-maven-3.0-bin.tar.gz

TAR-ZXVF apache-maven-3.0-bin.tar.gz

This creates a Maven installation directory apache-mmaven-3.0, which can be used after configuring environment variables directly, but for future upgrades it is recommended to create a symbolic link:

Ln-s apache-maven-3.0 Apache-maven

Next, create the MAVEN environment variable maven_home, and set the path

Export Maven_home=~/apache-maven #上面的安装路径

Export path= $PATH: $MAVEN _home/bin

In general, these two lines of command need to be added to the system's login shell script to Ubuntu16.04, edit the ~/.BASHRC file, add the two lines of command. Such

Here, the installation is complete. You can run the command to check if the MAVEN installation was successful:

Echo $MAVEN _home

Mvn-v

After running, it should show:

MAVEN's installation path and MAVEN version information, such as:

/home/jv/workplace/apache-maven

Apache Maven 3.0 (r1004208; 2010-10-04 19:50:56+0800)

Java version:1.8.0_112

Java Home/usr/lib/jvm/jdk1.8.0_112/jre

Default Locale:en_us, Platform Encoding:utf-8

OS name: "Linux" version: "4.4.0-22-generic" arch: "AMD64 Family:" Unix "

Maven (i) installation under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.