说明

系统版本:CenetOS 7  最小化安装

Java版本:jdk-8u192-linux-x64.tar.gz

maven:apache-maven-3.6.3-bin.tar.gz

操作系统安装过程参考:4000-Linux系统安装标准

Java 安装

下载 Java 安装包

可以通过云盘的地址下载:https://yunpan.myj.com.cn/d/cd546a85c96e48ee9300/解压到对应的文件夹

tar zxvf jdk-8u192-linux-x64.tar.gz
mv jdk1.8.0_192/ /usr/local/jdk

配置环境

vim /etc/profile
export JAVA_HOME=/usr/local/jdk
export JRE_HOME={$JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

生效及测试

source /etc/profile
[root@datax_111 ~]# java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)

maven 配置

下载安装包

通过访问 apache 的官网下载最新版本的 maven。https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/

tar zxvf apache-maven-3.6.3-bin.tar.gz
mv apache-maven-3.6.3 /usr/local/maven

配置国内源

vim /usr/local/maven/conf/settings.xml
<localRepository>/opt/jarstore</localRepository>

<mirror>
    <id>alimaven</id>
   <mirrorOf>central</mirrorOf>
   <name>aliyun maven</name>
   <url>https://maven.aliyun.com/repository/central</url>
</mirror>

<mirror>
   <id>aliyun-maven</id>
   <mirrorOf>*</mirrorOf>
   <name>aliyun maven</name>
   <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>

配置环境

和 java 的环境配置类似。

[root@datax_111 ~]# mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/maven
Java version: 1.8.0_192, vendor: Oracle Corporation, runtime: /usr/local/jdk/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1127.8.2.el7.x86_64", arch: "amd64", family: "unix"
[root@datax_111 ~]# 

参考

  • 无标签
写评论...