Eclipse Support for Java 8

Last week Java 8 was launched and moments later the Eclipse support for Java 8 was announced. To help celebrate the launch, we had an entire Java 8 Day at EclipseCon 2014, which included sessions from both Java and Eclipse engineers. Highlights for me included hearing Alex Buckley describe the Road to Lambda, listening to John Arthorne talk about API Design in Java 8 and watching the Eclipse Java Development Tools (JDT) Team present all the great work they did on Java 8 Tooling in Eclipse.

Java 8 is available as an update for Eclipse Kepler (2013 Release) and is now available nightly / integration builds towards Eclipse Luna (2014 Release). For details about how to get Java 8 support in Eclipse, please read to the bottom of this post.

New and Noteworthy

For those of you who were not lucky enough to join us in San Francisco, here is a summary of the Eclipse Support for Java 8.

Screen Shot 2014-03-24 at 3.45.13 PM

The Eclipse Java Compiler (EJC) now supports Java 8 and the tools are well integrated. There are quick-fixes, for converting anonymous inner classes (with a single method — i.e. functional interfaces) to a lambda expression:

Screen Shot 2014-03-24 at 3.43.37 PM

As well as ones for converting back, or even changing the body expression to a block (ctrl+1):

Screen Shot 2014-03-24 at 3.48.02 PM

And in-line refactoring support :

Screen Shot 2014-03-24 at 6.56.59 PM

There are Code Formatter options for lambda expressions such as ones that describe how the expression should be wrapped:

Screen Shot 2014-03-24 at 3.50.40 PM

And code clean-up actions which will convert the uses of anonymous classes to lambdas where possible. Simple enable this, and select Source -> Clean Up to automatically update your current code to use lambdas.

Screen Shot 2014-03-24 at 3.55.44 PM

The debugger supports breakpoints in lambdas as well as the variable view, and stack frame inspection:


While lambda support was clearly the most visible change in Java 8, there are a number of other features too. Features such as default methods (method bodies in your interfaces), better type inference and effectively final variables are all supported:

Screen Shot 2014-03-26 at 9.10.31 AM

Finally, Java 8 supports type annotations and Eclipse ships with a set of annotations for null analysis. For example, you can specify that a List should never be null, and each element of the list should also never be null. The JDT will provide compile time type checking to ensure this constraint holds.


This provides API designers with the facilities to create better interfaces with stricter rules about what can be passed to and returned from an API.


Java 8 represents one of the biggest Java releases ever. The JDT team should be really proud of the great work they did to support Java 8 in Eclipse.

For more information on Eclipse and Java 8, checkout Holger’s article on Java 8 and SWT.

Feel free to follow me (@irbull) on Twitter for more Eclipse updates.

[ Looking for tools? See our Eclipse Tools page. | Managing your Eclipse workspaces is easier with Yoxos. Create a free profile now. ]

Getting Java 8

Java 8 is available in builds towards Eclipse Luna (2014 Release coming in June) and as an update for Eclipse Kepler (2013 Release). To develop Java 8 applications, you will first need to install a Java 8 JDK. Additionally, please use an Eclipse version Luna or later

  • Eike Stepper
    Posted at 06:12, 2014-03-25

    Hi Ian, Nice summary! But isn’t the Quick Fix key ctrl+1 (not F1)?

  • R
    Posted at 19:00, 2014-03-25

    Seems a bit strange to say that Eclipse supports Java 8 when most people are using maven projects – and maven projects will require the Java 8 Facet which is not yet available. So I don’t think Eclipse can really say they support Java 8 yet…

  • JOKe
    Posted at 09:22, 2014-03-26

    the interface WTF example is wrong 🙂

  • R
    Posted at 10:00, 2014-03-26


    With how popular maven based build systems are, should they not be part of core Eclipse to start with? The other major IDEs have all moved in that direction and it might be hurting the popularity of Eclipse to require plugins to use Maven.

    In practice I’m pretty sure most eclipse developers are running the maven plugins anyway?

  • R
    Posted at 10:03, 2014-03-26

    Just to add: I don’t really like maven myself, but today if you want to use any OSS Java libraries (and considering how good they are, that means everyone using Java) it’s almost a requirement that you utilize maven.

  • Srihari KonaKanchi
    Posted at 10:45, 2014-03-30

    Hi Ian
    In your example you mentioned run method using outer field though not defining as ‘final’, it means a closure right?

    Srihari Konakanchi

  • Gaurav Bajpai
    Posted at 08:24, 2014-05-21

    Very nice and simple steps to get Java 8. Thanks for this superb article. @Ian Bull

  • Javin
    Posted at 05:53, 2014-06-07

    Good to know that now Eclipse is also supporting Java 8. I really find Netbeans content assist on use of lambda expressions in Java 8 effective which also adds onto your learning. Looking forward for better support and content assist in Eclipse.


  • Richard Steiger
    Posted at 10:18, 2014-06-19

    Given the recent announcements of both the Kepler patch and the 4.4 build, I was looking forward with great excitement to start doing some Java 8 development, and if it went smoothly, to start migrating my firm’s code-base to Java 8.

    Unfortunately, I’ve encountered what’s effectively a show-stopper bug: with jdk1.0.8_05 selected as the default JRE, opening a type hierarchy on a few JDK classes (Set, Collection, Consumer) reliably fails, with the message ‘Computing type hierarchy of has encountered a problem.’ The error log show an NPE being thrown (and BTW, in Luna, the stack trace is missing from the error log). This happens in both the updated Kepler (4.3.2 with the Java 8 update), and the latest Luna (4.4RC4) download. In both versions, with jdk1.7.0_60 set as the default JRE, no such problem occurs.

    As I indicated, this behavior renders eclipse unusable for our Java 8 migration project (our code base contains well over 25K classes, hence, navigating type hierarchies is one of our most heavily-used tools).

    I was unable to find any eclipse bugs fitting this symptom. If this seems like a new bug to any of you, please let me know and I’ll submit one (hints on best submission practice would be appreciated).

    Thanks much,



  • Richard Steiger
    Posted at 10:30, 2014-06-19

    I tried a different search pattern, and did find Bug 425111 (still open), which fits the symptoms, but not conditioned on Java 8 being the default JRE. I’ll add the above info to the bug.