问题描述
我使用Dotty模板创建了一个基本的Scala Dotty项目,并将该项目导入Intellij IDE.
当我使用sbt
命令行时,一切正常.
当我尝试在Intellij IDE中构建或运行它时,出现以下错误:
Error:scalac: Multiple 'scala-library*.jar' files (scala-library-0.9.0-RC1.jar, scala-library-2.12.6.jar) in Scala compiler classpath in Scala SDK sbt: ch.epfl.lamp:dotty-library_0.9:0.9.0-RC1:jar
有什么办法解决这个问题吗?
无论如何,当您将项目导入IntelliJ IDEA时,请选中使用sbt shell".至少对我来说,之后测试项目会编译并使用Ctrl + Shift + F10运行. >
可能并非所有功能都能正常工作.例如, Dotty宏不会,但是如果我手动编译并运行,它们就可以.
I created a basic Scala Dotty project using Dotty template and import the project to Intellij IDE.
Everything works fine when I use the sbt
command line.
When I try to build or run it inside Intellij IDE, I got following errors:
Error:scalac: Multiple 'scala-library*.jar' files (scala-library-0.9.0-RC1.jar, scala-library-2.12.6.jar) in Scala compiler classpath in Scala SDK sbt: ch.epfl.lamp:dotty-library_0.9:0.9.0-RC1:jar
Any ideas how to solve this?
Anyway when you import a project to IntelliJ IDEA check "use sbt shell". At least for me after that a test project compiles and runs with Ctrl+Shift+F10.
It's possible that not everything will work. For example Dotty macros don't but if I compile and run manually then they do.
这篇关于使用Intellij IDE运行Scala Dotty项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!