这个错误出现过若干次了,每次出现都想记录一下可是都忘了,然后下一次再遇见就又要搞很久才能解决,其实这本身是IntelliJ IDEA 2017.2
的一个bug
,只要修改一处配置就好了。
注:先前的文章里记得有个地方对这个问题表述的不正确,有时间再改。
原错误信息
原错误出现的IDEA
版本:2017.2;
原错误的出现场景:每次新建SBT项目并添加完SBT依赖之后出现;
原错误的表现:build.sbt
文件内容解析全部是红的,并且sbt shell
报错;
原错误报错如下:
[info] Loading settings from idea.sbt ...
[info] Loading global plugins from C:Usersmsi.sbt1.0plugins
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from I:IDEA_PROJVisualizationproject
[info] Loading settings from build.sbt ...
[info] Set current project to Visualization (in build file:/I:/IDEA_PROJ/Visualization/)
[info] sbt server started at local:sbt-server-a45abbca777ea4158128
sbt:Visualization>
[info] Defining Global / sbtStructureOptions, Global / sbtStructureOutputFile, shellPrompt
[info] The new values will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to Visualization (in build file:/I:/IDEA_PROJ/Visualization/)
[info] Applying State transformations org.jetbrains.sbt.CreateTasks from C:/Users/msi/.IntelliJIdea2017.2/config/plugins/Scala/launcher/sbt-structure-1.1.jar
[error] java.lang.ClassNotFoundException: org.jetbrains.sbt.CreateTasks$
[error] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
... ... ...
[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
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0
Bug解决方法
File
->Setting
->Build Tools
->SBT
,勾选Use SBT Shell for ...
参考
IDEA官方社区的帖子