2017-03-09 75 views
4

因此,我在Ubuntu上安裝了sbt,但是在終端執行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的全新安裝。

完整的輸出如下:

[email protected]:~$ 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 

回答

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),現在提示將顯示 '斯卡拉>'。輸入3 + 3,然後按回車進行測試。

如果輸入sbt後出現錯誤,請繼續。如果你沒有錯誤,恭喜!你安裝了Scala和sbt!

3)如果在步驟2中鍵入sbt產生類似下面的圖片錯誤,然後轉到步驟4

Picture of warning messages when running sbt

4)您需要將默認JDK版本更改爲8,爲表示對這裏的堆棧溢出的答案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。

Screenshot of what options to select to switch to JDK 8

5)然後SBT再次運行,它應該工作!