Caused by: java.lang.ClassNotFoundException: java.util.concurrent.Flow$Subscriber
Asked on September 23, 2018
I am creating a sample Reactive Streams example using Java 9 and eclipse.
Program is compiling correctly but throwing error on run.
Exception in thread "main" java.lang.NoClassDefFoundError: java/util/concurrent/Flow$Subscriber
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2688)
at java.lang.Class.getMethod0(Class.java:2937)
at java.lang.Class.getMethod(Class.java:1771)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: java.util.concurrent.Flow$Subscriber
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Replied on September 23, 2018
It seems that your eclipse is not configured with execution environment JRE 9.
Recheck.
Replied on September 23, 2018
It was JRE 1.8. I changed it to JRE 9 in my eclipse. Now working. Thanks.