11.2. Maven environment configuration

发布时间 :2025-10-25 12:23:16 UTC      

Maven is a Java-based tool, so the first thing to do is to install JDK.

If you have not installed JDK, you can refer to our Java 开发环境配置 .

11.2.1. System requirements

Project

Request

JDK

Maven 3.3 requires JDK 1.7 or above

Maven 3.2 requires JDK 1.6 or above

JDK 1.5 or above is required for Maven 3.0

Memory

There is no minimum requirement

Magnetic disk

The installation of Maven itself requires approximately 10 MB space. In addition, the extra disk space will be used for your local Maven repository. The size of your local warehouse depends on usage, but expect at least 500 MB

Operating system

There is no minimum requirement

11.2.2. Check Java installation

Operating system

Task

Command

Windows

Open the command console

c:\> java -version

Linux

Open the command terminal

# java -version

Mac

Open the terminal

$ java -version

11.2.3. Maven download

Maven download address: http://maven.apache.org/download.cgi

image0

Download the corresponding packages on different platforms:

System

Package name

Windows

Apache-maven-3.3.9-bin.zip

Linux

Apache-maven-3.3.9-bin.tar.gz

Mac

Apache-maven-3.3.9-bin.tar.gz

After downloading the package, extract it to the corresponding directory:

System

Storage location (can be configured according to your own situation)

Windows

E:Mavenapache-maven-3.3.9

Linux

/ usr/local/apache-maven-3.3.9

Mac

/ usr/local/apache-maven-3.3.9

11.2.4. Set the Maven environment variable

Add the environment variable MAVEN_HOME:

System

Configuration

Windows

Right-click “computer”, select “Properties”, then click “Advanced system Settings” and click “Environment variables” to set environment variables. The following system variables need to be configured:

New system variabl MAVEN_HOME , variable value: E:\ Maven\ apache-maven- 3.3.9

image1

Edit system variabl Path , add the variable value: ;% MAVEN_HOME%\ bin

image2

注意 Note that multiple values need to be separated by semicolons, and then click OK.

Linux

Download and decompress:

# wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
# tar -xvf  apache-maven-3.3.9-bin.tar.gz
# sudo mv -f apache-maven-3.3.9 /usr/local/

Editing /etc/profile File sudo vim /etc/profile To add the following code at the end of the file

export MAVEN_HOME=/usr/local/apache-maven-3.3.9
export PATH=${PATH}:${MAVEN_HOME}/bin

Save the file and run the following command to make the environment variable take effect:

# source /etc/profile

Enter the following command in the console. If you can see the relevant version information of Maven, it means that Maven has been installed successfully:

# mvn -v

Mac

Download and decompress:

$ curl -O http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
$ tar -xvf  apache-maven-3.3.9-bin.tar.gz
$ sudo mv -f apache-maven-3.3.9 /usr/local/

Editing /etc/profile File sudo vim /etc/profile To add the following code at the end of the file

export MAVEN_HOME=/usr/local/apache-maven-3.3.9
export PATH=${PATH}:${MAVEN_HOME}/bin

Save the file and run the following command to make the environment variable take effect:

$ source /etc/profile

Enter the following command in the console. If you can see the relevant version information of Maven, it means that Maven has been installed successfully:

$ mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /usr/local/apache-maven-3.3.9
Java version: 1.8.0_31, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: ISO8859-1
OS name: "mac os x", version: "10.13.4", arch: "x86_64", family: "mac"
Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.