I keep getting this error even though I have a 1.6+ version (I have 1.8), and i\'m working with IntelliJ.
P.S. I have tried to update both, java jre and java jdk, di
You may also need to ensure that your project has build/release set to the right java version. Without that, you may see an error like this:
Error:java: javacTask: source release 1.8 requires target release 1.8
The way to fix it for maven project is to enable build plugin in your pom file. This SO answer has specifics.