I\'m running a Java Maven project on IntelliJ, and I make sure that this project will be compiled by Java 1.8.
I set JRE to version 8 in Run/Debug Configuration
Make sure JAVA_HOME is set to JDK7 or JRE7. This is explained in the
following link
Make sure that you open a new shell an run intellij
The above 4 steps always helped me to troubleshoot such issues.