1. 程式人生 > >Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace th

Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace th


警告問題:

       Build path specifies execution environment J2SE-1.5. There are no JREs             installed in the workspace that are strictly compatible with this                               environment.       

       型別:JRE System Library Problem

解決辦法:

       找到Maven專案中的pom.xml檔案, 

      <build>
            <finalName>campuso2o</finalName>
      </build>修改為:

<build>
		<finalName>campuso2o</finalName>
		<plugins>
			<plugin>
				<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-
                     compiler-plugin 下面三行是從這個網址上找到的並去掉plugin標籤-->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.0</version>
                <!--此處是關聯jdk哪個版本和編碼型別-->
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF8</encoding>
				</configuration>
			</plugin>
		</plugins>
</build>

此時需要右鍵點選專案名,選擇Maven-->Update project,跟新一下專案,就可以了。