安装java
cd /opt
mkdir module
mkdir software
rpm -qa | grep -i java | xargs -n1 sudo rpm -e --nodeps
ls /opt/software/
tar -zxvf jdk-8u212-linux-x64.tar.gz -C /opt/module/
增加配置文件 /etc/profile.d/my_env.sh
#JAVA_HOME
export JAVA_HOME=/opt/module/jdk1.8.0_212
export PATH=$PATH:$JAVA_HOME/bin
安装maven:
wget --no-check-certificate https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar zxvf apache-maven-3.6.3-bin.tar.gz -C /opt/module/
文件/etc/profile.d/my_env.sh增加内容:
export MAVEN_HOME=/opt/module/apache-maven-3.6.3
export PATH=${PATH}:${MAVEN_HOME}/bin
刷新配置
source /etc/profile.d/my_env.sh
增加maven仓库,在文件 /opt/module/apache-maven-3.6.3/conf/settings.xml新增
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>nexus-osc</id>
<mirrorOf>*</mirrorOf>
<name>Nexus osc</name>
<url>http://maven.oschina.net/content/groups/public/</url>
</mirror>
测试mvn
mvn -version
安装sbt
sudo rm -f /etc/yum.repos.d/bintray-rpm.repo || true
curl -L https://www.scala-sbt.org/sbt-rpm.repo > sbt-rpm.repo
sudo mv sbt-rpm.repo /etc/yum.repos.d/
sudo yum install sbt
新增sbt的源:
参考:https://www.cnblogs.com/Do-n/p/13386440.html
新建目录 ~/.sbt,在该目录下新建文件repositories,内容为:
[repositories]
local
huaweicloud-maven: https://repo.huaweicloud.com/repository/maven/
maven-central: https://repo1.maven.org/maven2/
coursierapi-MavenRepository: https://maven.imagej.net/content/repositories/public/
sbt-plugin-repo: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/artifact.[ext]
修改文件/usr/share/sbt/conf/sbtopts,增加下面内容
-Dsbt.override.build.repos=true
测试:
sbt --version
docker安装
参考:https://blog.csdn.net/qq_43418737/article/details/125707321
新增文件/etc/docker/daemon.json 更改国内镜像源:
{
“registry-mirrors”: [
“http://hub-mirror.c.163.com”
]
,
“insecure-registries”: [
“http://hub-mirror.c.163.com”
]
}
systemctl daemon-reload
systemctl restart docker.service
systemctl status docker.service