Here is how you can solve the issue:
- In Eclipse IDE, open Window > Preferences > Java > Installed JREs > and check your installed JREs. You should see an entry with a JDK there.
- Select the Execution Env. Click OK
- Right-Click on your Project -> Maven -> Update Project
Also, you have to change the Maven JRE. Open Run -> Run Configurations, select the Maven Build. After that, click the JRE tab and selected the option Workspace default JRE.
If you want to learn Java, then check out this Java Training by Intellipaat.