Maven 安装步骤
- JDK 安装;在使用 Maven 之前,要确定已经安装了 JDK。
[email protected]:~$ java -version java version "1.7.0_21" Java(TM) SE Runtime Environment (build 1.7.0_21-b11) Java HotSpot(TM) Server VM (build 23.21-b01, mixed mode)
- 下载 Maven;下载地址: http://maven.apache.org/download.cgi
- 解压文件;将下载的 Maven 文件解压至指定的目录。
- 设置环境变量;
export M2_HOME=/home/huey/huey/java/maven/apache-maven-3.0.5 export PATH=${M2_HOME}/bin:$PATH
- 检查 Maven 安装情况;
-
[email protected]:~$ mvn -v Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51:28+0800) Maven home: /home/huey/huey/java/maven/apache-maven-3.0.5 Java version: 1.7.0_21, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-7-sun/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "3.5.0-43-generic", arch: "i386", family: "unix"
显示类似上述的信息,即表示 Maven 已安装配置成功。
时间: 2024-09-29 17:46:10