Latest version of Eclipse support JAVA8

Source: Internet
Author: User

The latest version of the Eclipse SDK Version:luna (4.4) Build id:i20140318-0830 download Link:

1. Select the version selected in the following figure:

2. Select your system corresponding SDK, I am the following figure specified version, (X86 system)

3. After the download, unpack and open eclipse. To use the Java8 feature, you also need to install JDK1.8, which is not detailed. Then eclipse needs to be configured.

In the window--->preference, set the following figure:

Select compiler to set the compiler version, we select 1.8, the following figure:

Finally, it's OK to set the JDK path. The following figure, my jdk1.8 is installed in the "D:\Program files\java\jdk1.8.0"

Then create a new Java project Test Java 8 lambda expression = = Test results are as follows:


public class Calculator {
    interface Integermath {
        int operation (int a, int b);   
    public int operatebinary (int a, int B, Integermath op) {return
        op.operation (A, b);
    public static void Main (String ... args) {
        Calculator myApp = new Calculator ();
        Integermath addition = (A, b)-> A + B;
        Integermath subtraction = (A, b)-> a-b;
        System.out.println ("+ 2 =" +
            myapp.operatebinary (2, addition));
        System.out.println ("20-10 =" +
            myapp.operatebinary (M, subtraction));    

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.