zl程序教程

您现在的位置是:首页 >  工具

当前栏目

IDEA报错Target level '1.6' is incompatible with source level '1.7'

IDEA 报错 &# is with 39 source Target
2023-09-14 08:58:27 时间

解决IDEA 编译级别
Error:java: Target level '1.6' is incompatible with source level '1.7'. A target level '1.7' or better is required

打开之后发现有一个编译级别设置的不对

更改如下:

如果上面的方法还是不行的话,就建议你改一下pom文件中的maven插件编译级别,可以通过搜索所有的pom.xml,1.6这个关键词,就看出来了。

	<profiles>
		<profile>
			<id>jdk1.7</id>
			<activation>
				<activeByDefault>true</activeByDefault>
				<jdk>1.7</jdk>
			</activation>
			<properties>
				<maven.compiler.source>1.7</maven.compiler.source>
				<maven.compiler.target>1.7</maven.compiler.target>
				<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
			</properties>
		</profile>
	</profiles>