scala 项目在 intellij 中不起作用

标签 scala intellij-idea sbt

在intellij中设置scala项目时,我收到以下错误日志:

Error:Error while importing SBT project:<br/>...<br/><pre>[error]   at 
sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:107)
[error]     at sbt.io.Using.apply(Using.scala:22)
[error]     at sbt.MainLoop$.runWithNewLog(MainLoop.scala:101)
[error]     at sbt.MainLoop$.runAndClearLast(MainLoop.scala:57)
[error]     at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:42)
[error]     at sbt.MainLoop$.runLogged(MainLoop.scala:34)
[error]     at sbt.StandardMain$.runManaged(Main.scala:113)
[error]     at sbt.xMain.run(Main.scala:76)
[error]     at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error]     at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error]     at xsbt.boot.Launch$.run(Launch.scala:109)
[error]     at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35) 
[error]     at xsbt.boot.Launch$.launch(Launch.scala:117)
[error]     at xsbt.boot.Launch$.apply(Launch.scala:18)
[error]     at xsbt.boot.Boot$.runImpl(Boot.scala:41)
[error]     at xsbt.boot.Boot$.main(Boot.scala:17)
[error]     at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.ClassNotFoundException: org.jetbrains.sbt.CreateTasks$
[error] Use 'last' for the full log.
[info] shutting down server</pre><br/>See complete log in <a href="file:/home/moritz/.IdeaIC2017.2/system/log/sbt.last.log">file:/home/xxxx/.IdeaIC2017.2/system/log/sbt.last.log</a>

我的 build.sbt 如下所示:
name := "someProjectName"

version := "0.1"

scalaVersion := "2.12.4"

libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"

另请注意,我的“旧”项目仍然有效,即仅在执行新项目时才会出现此问题。此外,我注意到当我点击最右边的 SBT 项目时,它会打开一个空窗口“SBT 项目”,对于我的其他项目,该窗口是非空的。

知道我在这里做错了什么吗?

非常感谢
C

最佳答案

如果你不想升级 Intellij 的麻烦,你可以在 sbt.properties 中降级 sbt 版本文件从 1.1.0(项目默认值)到例如 1.0.3。

关于scala 项目在 intellij 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48175632/

相关文章:

scala - Slick中如何进行版本并发控制?

java - Intellij IDEA 2018.1 Jdk10无法运行测试

java - 推送到存储库时忽略 .classpath 和 .project(或 .iml)是一种好习惯吗?

intellij-idea - IntelliJ IDEA Ultimate 项目加载问题

Scala 3 方法在使用镜像时太大

从 URL 下载/获取文件的 SBT 任务

scala - 重构修复尾部递归调用不在尾部位置的方法

arrays - 将 Long 转换为 Array Byte 的 Scala 方法

scala - 使用 SBT 包在 JAR 中包含依赖项

scala - 用 scala-mock 模拟一个特征的 val