IntelliJ:致命错误编译:无效的目标版本:1.8 [英] IntelliJ: Fatal error compiling: invalid target release: 1.8

查看:745
本文介绍了IntelliJ:致命错误编译:无效的目标版本:1.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在IntelliJ上运行Java Maven项目,并且确保该项目将由Java 1.8编译.

I'm running a Java Maven project on IntelliJ, and I make sure that this project will be compiled by Java 1.8.

我在运行/调试配置"中将JRE设置为版本8

I set JRE to version 8 in Run/Debug Configuration

,以及在项目结构中: 我的pom.xml文件还包含以下内容的Java版本8:

and also in Project Structure: My pom.xml file also includes java version 8 by the following:

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>

我还将Java编译器选项设置为1.8版.

I also set Java compiler option to version 1.8.

运行项目时,出现错误:

When I run the project, I get an error:

无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (默认编译)在项目feed_matcher上:致命错误: 无效的目标版本:1.8-> [帮助1]

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project feed_matcher: Fatal error compiling: invalid target release: 1.8 -> [Help 1]

您知道如何解决此问题吗?

Do you know how to resolve this issue?

PS,我点击了以下链接: IDEA :javac:源版本1.7需要目标版本1.7 ,但我仍然无法解决问题.

P.S I followed this link: IDEA: javac: source release 1.7 requires target release 1.7 and I still couldn't resolve the problem.

推荐答案

查看构建执行,部署>编译器> Java编译器

Look in Build Execution, Deployment > Compiler > Java Compiler

然后查找每个模块的字节码版本

Then look for per module bytecode version

这篇关于IntelliJ:致命错误编译:无效的目标版本:1.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆