Java 8无法在Intellij15上编译 [英] Java 8 doesn't compile on Intellij15

查看:178
本文介绍了Java 8无法在Intellij15上编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我们公司搬到了Java 8(以前使用的是Java 7)。
当我使用Eclipse时,一切都很好,但现在我切换到IntelliJ Idea 15(这是我第一次使用IntelliJ Idea)并且它根本不会编译任何Java 8代码(lambdas等)

Recently our company moved to Java 8 (previously working with Java 7). Everything was fine while I was using Eclipse, but now I switched to IntelliJ Idea 15 (it's my first time in IntelliJ Idea) and it simply won't compile any Java 8 code (lambdas, etc.)

我搜索了一个解决方案,发现我必须在IntelliJ项目设置中将项目语言级别设置为8,但它仍然没有帮助。

I searched for a solution and found out that I have to set a project language level to 8 in IntelliJ project settings, but it still doesn't help.

任何想法?

推荐答案

确保正确选择了JDK。

Make sure that you correctly selected the JDK.

在IntelliJ中你应该去:文件 - >项目结构...项目设置选项卡,并确保项目SDK指向您的Java 8 JDK的位置,(例如: C:\Program Files \ java \ jdk1.8.0_45

In IntelliJ you should go to: File -> Project Structure... project settings tab, and make sure the project SDK points to the location of your java 8 JDK, (something like: C:\Program Files\java\jdk1.8.0_45)

当然,确保项目语言级别设置为 8 - Lambdas,类型注释等。

And, of course, make sure the project language level is set to 8 - Lambdas, type annotations etc.

这篇关于Java 8无法在Intellij15上编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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