Flink编程中遇到“scala.tools.reflect.ToolBoxError: reflective compilation has failed: cannot initialize the compiler due to java.lang.NoClassDefFoundError: Could not initialize class scala.tools.nsc.Properties$”的解决方法
问题描述
scala的反射编译失败,无法编译有关类解决方法
在pom.xml文件中引入如下依赖(需对应自己的scala版本,我的是2.12.11) <dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>2.12.11</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>2.12.11</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.12.11</version>
</dependency>
后续会继续更新有关Flink编程的内容!
(注:第25次发文,如有错误和疑问,欢迎在评论区指出!)
——2021.12.10