问题描述:
IDEA运行Flink程序时报错,程序本身没有问题。
Error: A JNI error has occurred, please check your installation and try again
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/flink/api/java/DataSet
解决方案:
检查Maven版本,JDK版本,使用的编译版本,发现没有错误。
检查pom.xml文件,把里边的<scope>provided</scopoe>注释掉,程序可以运行。
如果不想注释掉:
点击【Run】→【Edit Configurations】→【Modify options】→勾选【Include dependencies with “Provided” scope】
参考:
- https://www.cnblogs.com/zlshtml/p/13796793.html
- https://blog.csdn.net/yscoder/article/details/109543786