TA的每日心情 | 衰 2021-2-2 11:21 |
---|
签到天数: 36 天 [LV.5]常住居民I
|
maven依赖JDK,所以要提前安装JDK
1. 安装jdk
- # cd /usr/local/
- # wget [url]http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-x64.tar.gz[/url]
- # tar -xzvf jdk-7u45-linux-x64.tar.gz
- # mv jdk-7u45-linux-x64 /usr/local/java
复制代码
2. 安装maven
- # wget http://apache.fayea.com/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
- # tar -xzvf apache-maven-3.3.9-bin.tar.gz
- # mv apache-maven-3.3.9-bin /usr/local/maven-3.3.9
复制代码
3. 环境变量配置
如下内容加入/etc/profile
- export JAVA_HOME=/usr/local/java/
- export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
- export PATH=$PATH:$JAVA_HOME/bin
- export MAVEN_HOME=/usr/local/maven-3.1.1
- export PATH=${PATH}:${MAVEN_HOME}/bin
复制代码 编辑完成后 # source /etc/profile
4. 分别测试
# java -version
# mvn -v
|
|