flink学习报错:java.lang.NoClassDefFoundError: org/apache/flink/streaming/api/datastream/DataStream

报错内容:

java.lang.NoClassDefFoundError: org/apache/flink/streaming/api/datastream/DataStream
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
	at java.lang.Class.getMethod0(Class.java:3018)
	at java.lang.Class.getMethod(Class.java:1784)
	at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.flink.streaming.api.datastream.DataStream
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 7 more

报错原因

没有导入flink 的lib下的jar包

解决方案:

将虚拟机安装的flink安装包在本地解压并在程序中指定到解压的flink的lib文件下就可以啦
flink学习报错:java.lang.NoClassDefFoundError: org/apache/flink/streaming/api/datastream/DataStream_第1张图片
flink学习报错:java.lang.NoClassDefFoundError: org/apache/flink/streaming/api/datastream/DataStream_第2张图片
flink学习报错:java.lang.NoClassDefFoundError: org/apache/flink/streaming/api/datastream/DataStream_第3张图片

ok,问题解决

你可能感兴趣的:(大数据学习,flink)