更新时间:2023-11-18 15:45:28
几天前我遇到了同样的错误。在我的例子中,我的JDK和我的Scala项目的选定目标JVM是不兼容的。
I was stuck with the same error a few days ago. In my case, it was an incompatibility of my JDK and the selected target JVM for my Scala project.
要检查当前的Java版本,请运行命令行上的java -version
。要在Eclipse中检查项目JVM目标,请转到项目>属性> Scala编译器并检查目标JVM(选择与当前Java相同的版本)。
To check your current Java version, run java -version
on the command line. To check your project JVM target in Eclipse, go to "Project > Properties > Scala Compiler" and check the target JVM (choose the same version as your current Java).
希望它有所帮助。