Linux系统-部署-运维系列导航 sbt安装支持2种安装方式,yum安装 与 二进制安装。
yum安装
scala-sbt官方下载 yum源
#下载yum源 [root@localhost kafka-manager]# wget https://www.scala-sbt.org/sbt-rpm.repo -O /etc/yum.repos.d/sbt-rpm.repo --2022-02-15 18:28:05-- https://www.scala-sbt.org/sbt-rpm.repo 正在解析主机 www.scala-sbt.org (www.scala-sbt.org)... 104.21.18.115, 172.67.181.202, 2606:4700:3037::6815:1273, ... 正在连接 www.scala-sbt.org (www.scala-sbt.org)|104.21.18.115|:443... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:108 [application/octet-stream] 正在保存至: “/etc/yum.repos.d/sbt-rpm.repo” 100%[=================================================================================================================================================>] 108 --.-K/s 用时 0s 2022-02-15 18:28:06 (61.6 MB/s) - 已保存 “/etc/yum.repos.d/sbt-rpm.repo” [108/108]) #yum 安装 [root@localhost kafka-manager]# yum install -y sbt
二进制安装
以1.6.2版本为例
1.scala-sbt官方下载二进制包,添加环境变量2.下载二进制包到 /usr/local/sbt,解压
[root@localhost ~]# cd /usr/local/sbt [root@localhost sbt]# tar -zxvf sbt-1.6.2.tgz sbt/ sbt/bin/ sbt/bin/sbtn-x86_64-pc-win32.exe sbt/bin/sbt sbt/bin/sbt.bat sbt/bin/sbtn-x86_64-pc-linux sbt/bin/sbt-launch.jar sbt/bin/sbtn-x86_64-apple-darwin sbt/conf/ sbt/conf/sbtconfig.txt sbt/conf/sbtopts sbt/LICENSE sbt/NOTICE3.添加环境变量
[root@localhost sbt]# vim /etc/profile 添加如下内容 #sbt env export SBT_HOME=/usr/local/sbt/sbt export PATH=$PATH:$SBT_HOME/bin [root@localhost sbt]# source /etc/profile
测试
[root@localhost sbt]# sbt sbtVersion
标签:bin,sbt,scala,CentOS7,yum,组件,root,localhost From: https://www.cnblogs.com/xiaoyaozhe/p/17671573.html