Follow these steps to solve this error:
• On Eclipse IDE, go to Window > Preferences > Java > Installed JREs > and verify your installed JREs. Check whether you have an entry with a JDK, if not create one.
• Choose the Execution Env. Click OK
• After this you need to Right-Click on Project -> Maven -> Update Project
If this doesn't work then Additionally, you may have to adjust Maven JRE which is as follows.
Goto Run -> Run Configurations, choosing the Maven Build you were running (from the left panel). Next, click the JRE tab and choose the option Workspace default JRE