Ubuntu安装sbt报错:Could not retrieve sbt 0.13.11
Ubuntu安装sbt报错在运行./sbt sbt-version命令后下面显示又该语句:You probably access the destination server through a proxy server that is not well configured.并且最后报错:Could not retrieve sbt 0.13.17经过分析发现主要问题还是连接的网络有问题,在火狐
·
Ubuntu安装sbt报错
在运行./sbt sbt-version命令后下面显示有该语句:
You probably access the destination server through a proxy server that is not well configured.
并且最后报错:
Could not retrieve sbt 0.13.11
于是我删掉之前的包,又参考 http://dblab.xmu.edu.cn/blog/2546-2/中的SBT安装方法,之后还是有以上的错误(可以跟着下面看一下,能否解决,不能的话再看这个)
经过分析发现主要问题还是连接的网络有问题,在火狐浏览器中网址打不开,并且在终端运行如下命令:
$ sudo apt-get update
显示无法连接域名,确认是网络连接有问题。
从新设置好网络,用浏览器打开网址确认能连上网后,我再次尝试运行如下命令:
$ cd /usr/local/sbt
$ ./sbt sbt-version
之前问题不再显示,但是一直不动,之后~/.sbt 路径下(.sbt文件为隐藏文件,按Ctrl+h可以显示出来),新建一个repositories文件(可以覆盖sbt的镜像源)加入如下内容:
[repositories]
local
huaweicloud-maven: https://repo.huaweicloud.com/repository/maven/
maven-central: https://repo1.maven.org/maven2/
sbt-plugin-repo: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext
再次尝试安装sbt,成功安装,但是之后会显示如下内容(不用管他,输入下面代码试试):
运行如下命令👇🏻:
$ cd /usr/local/sbt
$ ./sbt sbtVersion
结果如下图成功安装:
更多推荐
所有评论(0)