我正在尝试在IntelliJ中导入sbt和其他依赖项,但失败并显示以下错误。 我已经尝试过unresolved dependencies - Error while importing SBT project
给出的解决方案但是它不起作用。
下面是错误日志:
导入sbt项目时出错:
Java版本:1.7 虚拟机软件:最新版许可
Getting org.scala-sbt sbt 1.2.1 (this may take some time)...
unresolved dependency: org.scala-sbt#sbt;1.2.1: not found
(see /home/cloudera/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 1.2.1
:: problems summary ::
:::: WARNINGS
module not found: org.scala-sbt#sbt;1.2.1
==== local: tried
/home/cloudera/.ivy2/local/org.scala-sbt/sbt/1.2.1/ivys/ivy.xml
-- artifact org.scala-sbt#sbt;1.2.1!sbt.jar:
/home/cloudera/.ivy2/local/org.scala-sbt/sbt/1.2.1/jars/sbt.jar
==== local-preloaded-ivy: tried
file:////home/cloudera/.sbt/preloaded/org.scala-sbt/sbt/1.2.1/ivys/ivy.xml
==== local-preloaded: tried
file:////home/cloudera/.sbt/preloaded/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.pom
-- artifact org.scala-sbt#sbt;1.2.1!sbt.jar:
file:////home/cloudera/.sbt/preloaded/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.jar
==== Maven Central: tried
https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.pom
-- artifact org.scala-sbt#sbt;1.2.1!sbt.jar:
https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.jar
==== sbt-maven-releases: tried
https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.pom
-- artifact org.scala-sbt#sbt;1.2.1!sbt.jar:
https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.jar
==== sbt-maven-snapshots: tried
https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.pom
-- artifact org.scala-sbt#sbt;1.2.1!sbt.jar:
https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.jar
==== typesafe-ivy-releases: tried
https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.1/ivys/ivy.xml
==== sbt-ivy-snapshots: tried
https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.2.1/ivys/ivy.xml
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;1.2.1: not found
::::::::::::::::::::::::::::::::::::::::::::::
:::: ERRORS
Server access Error: Received fatal alert: protocol_version url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.pom
Server access Error: Received fatal alert: protocol_version url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.jar
Server access Error: Connection reset url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.pom
Server access Error: Connection reset url=https://repo.scala-sbt.org/scalasbt/maven-releases/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.jar
Server access Error: Connection reset url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.pom
Server access Error: Connection reset url=https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt/1.2.1/sbt-1.2.1.jar
Server access Error: Connection reset url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/1.2.1/ivys/ivy.xml
Server access Error: Connection reset url=https://repo.scala-sbt.org/scalasbt/ivy-snapshots/org.scala-sbt/sbt/1.2.1/ivys/ivy.xml
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
Error during sbt execution: Error retrieving required libraries
答案 0 :(得分:0)
这是cloudera VM固件的常见问题。 jdk版本是1.7,而scala 2.12需要jdk版本1.8。
下载最新的jdk并将其解压缩到桌面上。并且,当您为scala打开一个新项目时,请确保您的jdk指向您下载的最新版本。(默认情况下,它将使用随cloudera VM软件一起提供的jdk 1.7。
希望这会有所帮助。