每个新的IntelliJ Scala项目中都没有"scala-library * .jar" [英] No 'scala-library*.jar' in every new IntelliJ Scala Project
问题描述
我已经在Ubuntu 16.04LTS上安装了带scala插件的intelliJ-IDEA 2017.2.5.当我创建新的scala项目并尝试运行它时,我得到:
I have installed intelliJ-IDEA 2017.2.5 with scala plugin on Ubuntu 16.04LTS. When I create new scala project and try to run it I get:
错误:scalac:Scala SDK SBT的Scala编译器类路径中没有"scala-library * .jar":org.scala-lang:scala-library:2.12.4:jar
Error:scalac: No 'scala-library*.jar' in Scala compiler classpath in Scala SDK SBT: org.scala-lang:scala-library:2.12.4:jar
我可以通过以下方法修复该问题:转到项目结构">库",删除库并再次添加.
I can fix it by going to Project Structure > Libraries, deleting libraries and adding them again.
是否可以更改默认库,所以我不必在每次创建新项目时都这样做?
Is there a way to change default library so I don't have to do this every time I create new project?
推荐答案
如果您使用的是sbt 1.0.2,则此问题可能是由于sbt中的错误所致.预计将对sbt 1.0.3进行修复.
If you are using sbt 1.0.2, this problem might be due to a bug in sbt. A fix is expected for sbt 1.0.3.
相关问题:
- https://youtrack.jetbrains.com/issue/SCL-12591
- https://github.com/sbt/sbt/issues/3560
可能的解决方法:
- 配置Scala 2.12.3版本
- 或降级至sbt 0.13.16
这篇关于每个新的IntelliJ Scala项目中都没有"scala-library * .jar"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!