错误:java:无效源版本:8在Intellij。这是什么意思? [英] Error:java: invalid source release: 8 in Intellij. What does it mean?

查看:3810
本文介绍了错误:java:无效源版本:8在Intellij。这是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译一些代码在我使用Intellij Ultimate 13.1.4,但我得到以下错误,我不知道这是什么意思:

Im trying to compile some code in I'm using Intellij Ultimate 13.1.4, but I get the following error and I have no idea what it means:

Information:Using javac 1.7.0_55 to compile java sources
Information:java: Errors occurred while compiling module 'Example'
Information:Compilation completed with 1 error and 0 warnings in 3 sec
Information:1 error
Information:0 warnings
Error:java: invalid source release: 8

我的猜测是它的东西与Java 8对比Java 7,但我不知道具体什么。我试着谷歌这个消息,但他们谈论 javac 目标版本,所以它doesn

My guess is that its something related to Java 8 vs Java 7, but I have no idea what specifically. I've tried to Google around for this message, but they either talk about javac or target release, so it doesn't exactly seem to apply.

推荐答案

在将项目从Java 8降级到Java 6时,我也遇到了同样的问题。原因是它在IntelliJ的所有地方没有改变。

I had the same issue when "downgrading" a project from Java 8 to Java 6. The reason was that it was not changed at all places in IntelliJ.

在IntelliJ 13.1.4我不得不改变Java和SDK版本在以下地方不得到这个错误:

In IntelliJ 13.1.4 I had to change Java and SDK version on the following places not to get this error:


  • 文件 - >项目结构 - >项目设置

  • 文件 - >项目
    结构 - >模块设置 - > Tab:依赖关系:模块SDK

  • 文件 - >
    项目结构 - >模块设置 - >选项卡: >
  • 文件 - >设置 - >编译器 - > Java编译器 - >目标字节码
    版本

最后一个项目符号是在我的情况下没有更新。一旦我改变了这一点,错误就消失了。

The last bullet was the one that was not updated in my case. Once I changed this, the error disappeared.

这篇关于错误:java:无效源版本:8在Intellij。这是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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