centos7的java,maven,sbt,docker安装和配置

安装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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值