You need to run and compile your application on the 1.8 version of Java.
For Eclipse you should:
1) click "Window> Preferences", and in the window that appears on the left, select "Java", click "Installed JREs", click "Add ...", go to the folder containing the JDK.
2) Right-click on the project and select "Properties" on the left side of the window, click on "Java Compiler" and uncheck "Use compliance from the runtime on the Java build path", which allows you to choose from the "Compiler Compilation" list use the same The version you installed in the previous step.
for NetBeans IDE, right-click the project and select βPropertiesβ, then go to sources, then you can change the source / binary format to upper
JDK version.
source share