When this error occurs, it means that the version of your compiler is not compatible with the version of jdk
Solution:
After downloading a 1.8 jdk installation, reconfigure the environment variables
Then replace the several positions marked in the following figure with the ones of jdk1.8