1. Right-click the project and select Preferences ->; Search project called Facets – & gt; Go to Java and select compile environment 1.7, enter Runtime, select a Tomcat, and click New:
Select Tomcat7, click Apply, and click OK:
Click Configuration, select the Tomcat you just selected, when done, click Apply, and click OK:
Then select the project and right-click ->; Select Build Path ->; Select Configure build path:
Select libraries – & gt; Select the JRE System Library ->; Click Edit to change the compile environment:
Select the default build environment, mine is JDK 1.8, and click Finish:
Select Tomcat7, click Apply, and click OK:
Click Configuration, select the Tomcat you just selected, when done, click Apply, and click OK:
Then select the project and right-click ->; Select Build Path ->; Select Configure build path:
Select libraries – & gt; Select the JRE System Library ->; Click Edit to change the compile environment:
Select the default build environment, mine is JDK 1.8, and click Finish: