scala - 下载异常 : sun. security.validator.ValidatorException:未找到受信任的证书

标签 scala sbt ubuntu-16.04

我正在尝试在 Ubuntu 16.04 上使用 sbt,但是在尝试运行它时出现错误。我进行了全新安装,然后完全按照 the sbt site 中的说明进行操作。 ,但是当我做 sbt 时得到以下信息:

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/main/0.13.12/jars/main.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/compiler-interface/0.13.12/jars/compiler-interface.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/actions/0.13.12/jars/actions.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/main-settings/0.13.12/jars/main-settings.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/io/0.13.12/jars/io.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/ivy/0.13.12/jars/ivy.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/command/0.13.12/jars/command.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/completion/0.13.12/jars/completion.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/api/0.13.12/jars/api.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/collections/0.13.12/jars/collections.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/incremental-compiler/0.13.12/jars/incremental-compiler.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

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

    ==== local: tried

      /home/james/.ivy2/local/org.scala-sbt/compile/0.13.12/jars/compile.jar

    ==== Maven Central: tried

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

    ==== typesafe-ivy-releases: tried

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

    ==== sbt-ivy-snapshots: tried

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

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

        ::              FAILED DOWNLOADS            ::

        :: ^ see resolution messages for details  ^ ::

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

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

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

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

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

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

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

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

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

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

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

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

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

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



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

我不确定是什么导致了这种情况。我也试过 sudo sbt ,这没有什么区别(如果是权限错误)。我应该注意到一些下载成功。

编辑:

这是我做对的一些证据:

I'm not dumb

最佳答案

在 Ubuntu 上,当你有包 openjdk-9-jre-headless安装后,sbt 无法验证其下载,因为它们没有根据 OpenJDK 9 证书进行签名。要解决此问题,您需要卸载 OpenJDK 9:

$ apt-get remove openjdk-9-*

然后确保你有 openjdk-8-jre-headless安装并使用 update-java-alternatives选择它作为默认 JRE(查看 https://askubuntu.com/a/731862/459610 了解详细信息)。

答案在 https://medium.com/@henricook/solution-to-sun-security-validator-validatorexception-e300dd7dba70#.wn7uh2z9q 中找到

(注意:我现在不在 Ubuntu 机器上,所以我无法验证这一点,但是:您可能只需将默认 Java 设置为 JDK 8。)

关于scala - 下载异常 : sun. security.validator.ValidatorException:未找到受信任的证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40165525/

相关文章:

c - 如何创建一个简单的驱动程序? [乌类图]

scala - 将行或列转换为数据框

sbt - 为什么 SBT 不下载我自己的 libraryDependencies?

scala - 使用SBT程序集JAR在Spark提交中,Spark无法找到应用程序类本身(ClassNotFoundException)

python - 在python的Elasticsearch中批量插入时出现连接错误

redis - 启动redis.service失败 : Unit redis-server. 服务被屏蔽

scala - Akka Scala TestKit 测试 PoisonPill 消息

scala - 生成字母数字字符串

scala - scala 如何对元组排序?

scala - 使用 SBT 生成不包含 Scala 补丁版本的 JAR 文件名