在 Linux 上安装 SBT

Install SBT on Linux

我正在尝试为 Scala 开发安装 SBT。我按照 Installing sbt manually

中的指南

报错如下

:: problems summary ::
:::: WARNINGS
        module not found: org.scala-sbt#sbt;0.13.7

    ==== local: tried

      /home/nan/.ivy2/local/org.scala-sbt/sbt/0.13.7/ivys/ivy.xml

      -- artifact org.scala-sbt#sbt;0.13.7!sbt.jar:

      /home/nan/.ivy2/local/org.scala-sbt/sbt/0.13.7/jars/sbt.jar

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.7/ivys/ivy.xml

    ==== Maven Central: tried

      https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.pom

      -- artifact org.scala-sbt#sbt;0.13.7!sbt.jar:

      https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.jar

        ::::::::::::::::::::::::::::::::::::::::::::::

        ::          UNRESOLVED DEPENDENCIES         ::

        ::::::::::::::::::::::::::::::::::::::::::::::

        :: org.scala-sbt#sbt;0.13.7: not found

        ::::::::::::::::::::::::::::::::::::::::::::

    :::::: ERRORS

    Server access Error: Connection refused url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.7/ivys/ivy.xml

    Server access Error: Connection refused url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.pom

    Server access Error: Connection refused url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.jar


    :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
    unresolved dependency: org.scala-sbt#sbt;0.13.7: not found
    Error during sbt execution: Error retrieving required libraries (see /home/nan/.sbt/boot/update.log for complete log)
    Error: Could not retrieve sbt 0.13.7

即使在浏览器中也无法访问link“https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.7/sbt-0.13.7.jar”。有什么解决办法吗?

正如评论者所说,看来您只是遇到了网络连接问题。

但是,如果您不使用包管理器,我建议使用 here 中的 "sbt-extras" 脚本。即

curl -s https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt \
  > ~/bin/sbt && chmod 0755 ~/bin/sbt