[Linux] CentOS6.7成功安装sbt

安装环境

Linux:CentOS6.7

sbt:sbt-0.13.15


1 - yum安装sbt

sbt二进制文件发布到bintray,而Bintray方便地提供了RPM资源库。我们只需要将存储库添加到全举报管理器将检查的地方。

[root@vm bin]# curl https://bintray.com/sbt/rpm/rpm > bintray-sbt-rpm.repo
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload  Upload   Total   Spent    Left  Speed
159   159    0   159    0     0    121      0 --:--:--  0:00:01 --:--:--   230
[root@vm bin]# sudo mv bintray-sbt-rpm.repo /etc/yum.repos.d/
[root@vm bin]# sudo yum install sbt

这里如果选择手动安装,去sbt官网下载压缩包,到服务器上解压安装。设置完环境变量即可使用。


2 - 完成安装

安装完成后第一次输入sbt命令,界面会卡住,实际上是在下载相关的依赖包。国外镜像巨慢,估计要好几个小时。

由于sbt默认的reoisitory是maven,里面有些会被墙。所以修改为aliyun的repository,再下载

配置aliyun的repository

[root@vm .sbt]# vi ~/.sbt/repositories
[repositories]
  local
  aliyun-nexus: http://maven.aliyun.com/nexus/content/groups/public/
  jcenter: https://jcenter.bintray.com/
  typesafe-ivy-releases: https://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
  maven-central

注意:检查上面命令,每一行最后不要留空格,否则会报错!

运行sbt,开始下载jar包。虽然速度也不快,但是能成功安装!

[root@vm .sbt]# sbt
Getting org.scala-sbt sbt 0.13.15  (this may take some time)...

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/ivy/0.13.15/jars/ivy.jar ...
	[SUCCESSFUL ] org.scala-sbt#ivy;0.13.15!ivy.jar (142039ms)
downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/tracking/0.13.15/jars/tracking.jar ...
	[SUCCESSFUL ] org.scala-sbt#tracking;0.13.15!tracking.jar (11548ms)
downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/incremental-compiler/0.13.15/jars/incremental-compiler.jar ...
	[SUCCESSFUL ] org.scala-sbt#incremental-compiler;0.13.15!incremental-compiler.jar (31245ms)
downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/cache/0.13.15/jars/cache.jar ...
	[SUCCESSFUL ] org.scala-sbt#cache;0.13.15!cache.jar (26973ms)
downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/test-agent/0.13.15/jars/test-agent.jar ...
	[SUCCESSFUL ] org.scala-sbt#test-agent;0.13.15!test-agent.jar (28292ms)

等待命令完成,sbt安装完成。

验证安装

[root@vm ~]# sbt
[info] Loading project definition from /root/project
[info] Set current project to root (in build file:/root/)
>


下载过程中vi ~/.sbt/boot/update.log可以查看进度。

如果sbt开始报lock的错,将~/.sbt/boot下的sbt.boot.lock文件删除即可。






  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值