1、在項目上右鍵-->build path---->config build path 選擇本機jdk不要jre
、、、、
若以上不行
2、選擇編譯的方式,在項目上右鍵-->properties--->選擇 java compiler 按照圖中制定jdk
3、在maven項目中制定編譯的方式
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
4、右鍵ruan as ---> run configuartions指定jdk版本