IntelliJ IDEA---Warning:java: 源值1.5已过时, 将在未来所有发行版中删除

这个问题今天刚刚遇到,我的jdk为1.8,查到的解释是:Idea默认把项目的源代码版本设置成了jdk1.5,目标代码设置为jdk1.5。

解决方法也很简单,修改Maven的settings.xml文件。如下:

<profile>
	<id>jdk-1.8</id>
	<activation>
		<activeByDefault>true</activeByDefault>
		<jdk>1.8</jdk>
	</activation>
	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
	</properties>
</profile>

猜你喜欢

转载自blog.csdn.net/luyanc/article/details/80340124