【问题标题】:sbt fails to download componentssbt 无法下载组件
【发布时间】:2017-07-29 19:02:25
【问题描述】:

因此,我使用 . 处的说明在 Ubuntu 上安装了 sbt,但是当我在终端执行 sbt 时,我收到下载失败的错误,因为“未找到受信任的证书”。我做的不多,所以我不确定我做错了什么。

我已使用 Google Chrome 成功下载了其中一个组件 (https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.13/jars/main.jar),但没有注意到它报告任何 HTTPS 证书错误。

这是 Ubuntu 16.04 Parallels 中的全新安装。

完整输出如下:

parallels@ubuntu:~$ sbt
Getting org.scala-sbt sbt 0.13.13 ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.13/jars/main.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.13/jars/compiler-interface.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/actions/0.13.13/jars/actions.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main-settings/0.13.13/jars/main-settings.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/io/0.13.13/jars/io.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/ivy/0.13.13/jars/ivy.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/command/0.13.13/jars/command.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/completion/0.13.13/jars/completion.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/api/0.13.13/jars/api.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/collections/0.13.13/jars/collections.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/incremental-compiler/0.13.13/jars/incremental-compiler.jar ...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compile/0.13.13/jars/compile.jar ...

:: problems summary ::
:::: WARNINGS
        [FAILED     ] org.scala-sbt#main;0.13.13!main.jar: sun.security.validator.ValidatorException: No trusted certificate found (16019ms)

        [FAILED     ] org.scala-sbt#main;0.13.13!main.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/main/0.13.13/jars/main.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.13/jars/main.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/main/0.13.13/jars/main.jar

        [FAILED     ] org.scala-sbt#compiler-interface;0.13.13!compiler-interface.jar: sun.security.validator.ValidatorException: No trusted certificate found (754ms)

        [FAILED     ] org.scala-sbt#compiler-interface;0.13.13!compiler-interface.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/compiler-interface/0.13.13/jars/compiler-interface.jar

    ==== Maven Central: tried

      https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/0.13.13/compiler-interface-0.13.13.jar

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.13/jars/compiler-interface.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/compiler-interface/0.13.13/jars/compiler-interface.jar

        [FAILED     ] org.scala-sbt#actions;0.13.13!actions.jar: sun.security.validator.ValidatorException: No trusted certificate found (763ms)

        [FAILED     ] org.scala-sbt#actions;0.13.13!actions.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/actions/0.13.13/jars/actions.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/actions/0.13.13/jars/actions.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/actions/0.13.13/jars/actions.jar

        [FAILED     ] org.scala-sbt#main-settings;0.13.13!main-settings.jar: sun.security.validator.ValidatorException: No trusted certificate found (789ms)

        [FAILED     ] org.scala-sbt#main-settings;0.13.13!main-settings.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/main-settings/0.13.13/jars/main-settings.jar

    ==== Maven Central: tried

      https://repo1.maven.org/maven2/org/scala-sbt/main-settings/0.13.13/main-settings-0.13.13.jar

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main-settings/0.13.13/jars/main-settings.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/main-settings/0.13.13/jars/main-settings.jar

        [FAILED     ] org.scala-sbt#io;0.13.13!io.jar: sun.security.validator.ValidatorException: No trusted certificate found (766ms)

        [FAILED     ] org.scala-sbt#io;0.13.13!io.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/io/0.13.13/jars/io.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/io/0.13.13/jars/io.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/io/0.13.13/jars/io.jar

        [FAILED     ] org.scala-sbt#ivy;0.13.13!ivy.jar: sun.security.validator.ValidatorException: No trusted certificate found (770ms)

        [FAILED     ] org.scala-sbt#ivy;0.13.13!ivy.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/ivy/0.13.13/jars/ivy.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/ivy/0.13.13/jars/ivy.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/ivy/0.13.13/jars/ivy.jar

        [FAILED     ] org.scala-sbt#command;0.13.13!command.jar: sun.security.validator.ValidatorException: No trusted certificate found (712ms)

        [FAILED     ] org.scala-sbt#command;0.13.13!command.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/command/0.13.13/jars/command.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/command/0.13.13/jars/command.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/command/0.13.13/jars/command.jar

        [FAILED     ] org.scala-sbt#completion;0.13.13!completion.jar: sun.security.validator.ValidatorException: No trusted certificate found (705ms)

        [FAILED     ] org.scala-sbt#completion;0.13.13!completion.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/completion/0.13.13/jars/completion.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/completion/0.13.13/jars/completion.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/completion/0.13.13/jars/completion.jar

        [FAILED     ] org.scala-sbt#api;0.13.13!api.jar: sun.security.validator.ValidatorException: No trusted certificate found (769ms)

        [FAILED     ] org.scala-sbt#api;0.13.13!api.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/api/0.13.13/jars/api.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/api/0.13.13/jars/api.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/api/0.13.13/jars/api.jar

        [FAILED     ] org.scala-sbt#collections;0.13.13!collections.jar: sun.security.validator.ValidatorException: No trusted certificate found (703ms)

        [FAILED     ] org.scala-sbt#collections;0.13.13!collections.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/collections/0.13.13/jars/collections.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/collections/0.13.13/jars/collections.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/collections/0.13.13/jars/collections.jar

        [FAILED     ] org.scala-sbt#incremental-compiler;0.13.13!incremental-compiler.jar: sun.security.validator.ValidatorException: No trusted certificate found (721ms)

        [FAILED     ] org.scala-sbt#incremental-compiler;0.13.13!incremental-compiler.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/incremental-compiler/0.13.13/jars/incremental-compiler.jar

    ==== Maven Central: tried

      https://repo1.maven.org/maven2/org/scala-sbt/incremental-compiler/0.13.13/incremental-compiler-0.13.13.jar

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/incremental-compiler/0.13.13/jars/incremental-compiler.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/incremental-compiler/0.13.13/jars/incremental-compiler.jar

        [FAILED     ] org.scala-sbt#compile;0.13.13!compile.jar: sun.security.validator.ValidatorException: No trusted certificate found (817ms)

        [FAILED     ] org.scala-sbt#compile;0.13.13!compile.jar:  (0ms)

    ==== local: tried

      /home/parallels/.ivy2/local/org.scala-sbt/compile/0.13.13/jars/compile.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

      https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compile/0.13.13/jars/compile.jar

    ==== sbt-ivy-snapshots: tried

      https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/compile/0.13.13/jars/compile.jar

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

        ::              FAILED DOWNLOADS            ::

        :: ^ see resolution messages for details  ^ ::

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

        :: org.scala-sbt#main;0.13.13!main.jar

        :: org.scala-sbt#actions;0.13.13!actions.jar

        :: org.scala-sbt#io;0.13.13!io.jar

        :: org.scala-sbt#completion;0.13.13!completion.jar

        :: org.scala-sbt#collections;0.13.13!collections.jar

        :: org.scala-sbt#api;0.13.13!api.jar

        :: org.scala-sbt#incremental-compiler;0.13.13!incremental-compiler.jar

        :: org.scala-sbt#compile;0.13.13!compile.jar

        :: org.scala-sbt#ivy;0.13.13!ivy.jar

        :: org.scala-sbt#main-settings;0.13.13!main-settings.jar

        :: org.scala-sbt#command;0.13.13!command.jar

        :: org.scala-sbt#compiler-interface;0.13.13!compiler-interface.jar

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



:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
download failed: org.scala-sbt#main;0.13.13!main.jar
download failed: org.scala-sbt#actions;0.13.13!actions.jar
download failed: org.scala-sbt#io;0.13.13!io.jar
download failed: org.scala-sbt#completion;0.13.13!completion.jar
download failed: org.scala-sbt#collections;0.13.13!collections.jar
download failed: org.scala-sbt#api;0.13.13!api.jar
download failed: org.scala-sbt#incremental-compiler;0.13.13!incremental-compiler.jar
download failed: org.scala-sbt#compile;0.13.13!compile.jar
download failed: org.scala-sbt#ivy;0.13.13!ivy.jar
download failed: org.scala-sbt#main-settings;0.13.13!main-settings.jar
download failed: org.scala-sbt#command;0.13.13!command.jar
download failed: org.scala-sbt#compiler-interface;0.13.13!compiler-interface.jar
Error during sbt execution: Error retrieving required libraries
  (see /home/parallels/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.13.13

【问题讨论】:

    标签: scala ubuntu sbt


    【解决方案1】:

    在自己在 Ubuntu 上安装 sbt 遇到这个问题后,我找到了解决方案。我相信我们有同样的错误,所以这应该解决它。我从头到尾提供了在 Ubuntu 上下载和安装 sbt 的步骤。如果您只想修复错误,请从第 4 步开始。

    在终端中输入以下命令。请注意,如果您转到www.scala-sbt.org/download.html,您可以找到这些命令。

    echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
    sudo apt-get update
    sudo apt-get install sbt
    

    2) 现在在终端输入sbt,它应该会安装一些 .jar 文件并给你一个 REPL('>' 符号)。

    2.1) 如果可行,请在“>”符号后输入console,然后按回车键

    2.2) 现在提示将显示为“scala>”。键入 3+3,然后按 Enter 来测试一下。

    如果您在输入 sbt 后出现错误,请继续。如果您没有错误,那么恭喜!你安装了 Scala 和 sbt!

    3) 如果在步骤 2 中输入 sbt 产生类似于下图的错误,则转到步骤 4。

    4) 您需要将默认 JDK 版本更改为 8,如 Stack Overflow 答案中所述Exception on download: sun.security.validator.ValidatorException: No trusted certificate found

    4.1) 输入sudo update-alternatives --config java

    4.2) 选择路径中带有 java-8 的选项。

    注意:如果您在路径中没有 java-8 选项,您应该能够下载 JDK8,然后返回步骤 4.1 将其设置为默认 JDK。

    5) 然后再次运行 sbt,它应该可以工作了!

    【讨论】:

    • 我需要 Java 8
    猜你喜欢
    • 2020-01-22
    • 2015-06-19
    • 2021-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-22
    相关资源
    最近更新 更多