简体   繁体   中英

How do I use Java 8 features in Eclipse Luna?

I've installed JDK 8. I set my JAVA_HOME to the JDK 8 directory. I downloaded the latest Eclipse Luna. I checked for updates. I set my default (and only) Installed JRE to the JDK 8 directory.

I cannot set my project nor workspace compliance level to 1.8. I even tried manually editing the preferences file to 1.8 to no avail.

What am I doing wrong? Hopefully it's something simple.

PS My project builds with java 8 fine. I'm using gradle with source and target set to 1.8 and it builds and generates eclipse files, but still doesn't work.

Luna will support Java 8 by default starting at Luna M7. For the time being you can install the Java 8 support patch for Kepler (either on Luna or Kepler).

Here is the update site: http://download.eclipse.org/eclipse/updates/4.3-P-builds/

we can use most popular jdk 8 features called "A lambda expression" we can use this in the java IDE EE eclipse, usage is similar to the java program

Standard Syntax Syntax:

(parameter-list) -> {body} Standard syntax of lambda expression contains three parts.

A list of parameter: It can be empty or non-empty as well. Arrow-token: It is used to link parameter-list and body of expression. body: It contains expressions and statements for lambda expressio

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM