在IntelLij IDEA中下载了scala插件,IntelliJ IDEA版本 2021.1.1 x64,scala版本2021.1.22,jdk1.8.0_91。测试运行时报错

在IntelLij IDEA中下载了scala插件,运行时报错scalac: Error: Error compiling the sbt component 'compiler-interface-2.7.0-final-52.0'

img

img


创建的maven

img

img

试试这样写,看看对不对


object HelloWorld {
   /* 
    * 以下程序将输出'Hello World!' 
    */
   def main(args: Array[String]) {
      println("Hello, world!") // 输出 Hello World
   }
}

你这个问题一般是版本冲突,检查JDK版本和scala版本。
补充一下,IntelliJ IDEA版本 2021.1.1 x64这个版本太难用,莫名其妙的问题,一般用2019,比较好用的一个版本是2019.2,个人建议。