Check lambda support in IntelliJ IDEA 12 EAP build 122.202

A new EAP build 122.202 of IntelliJ IDEA 12 has been released. The build contains improved JDK8 lambda inference and initial code insight features:

  • Anonymous class can be replaced with lambda inspection with a quick fix
  • Intention to replace lambda with anonymous class
  • Intention to insert inferred lambda parameter types

You can find the complete list of changes in the build. Download it or upgrade from within the IDE using the “Check for updates” feature.

This entry was posted in EAP Releases and tagged , . Bookmark the permalink.

14 Responses to Check lambda support in IntelliJ IDEA 12 EAP build 122.202

  1. Dee says:

    No way. Just No way! Niice :-)

  2. jtonic says:

    Great news.

    I’ve created a java project with latest JDK8 and I didn’t managed to run it:
    error: lambda expressions are not supported in -source 1.8
    (use -source 8 or higher to enable lambda expressions)
    I’ve tried to configure the Java Compiler additional options without success.

    Also Idea complains about creating a new TreeSet passing an inline lambda expression. If I extract the lambda expression in a separate local variable the error has gone.

    public class LambdaTest {
    public static void main(String[] args) {
    Comparator c = (o1, o2)->{
    return o2.compareToIgnoreCase(o1);
    Set strs = new TreeSet(c);

    for (String str : strs) {
    System.out.println(“str = ” + str);


  3. Kon Soulianidis says:

    Hi jtonic
    Make sure you get the correct build of JDK8 with lambdas enabled.
    The regular one does not have it

  4. Anna Kozlova says:

    in order to get java build with lambda support you need to download it from It is not merged yet in the common repository, sorry not mentioned that.

  5. Denny says:

    What’s the font in the picture?

  6. jtonic says:

    Thank you Anna

    It works.

    Regarding the other issue, is it a JDK-1.8 issue or IDE one?


  7. Anna Kozlova says:

    actually this code
    Set strs = new TreeSet();
    for (String str : strs) {}
    should not compile (and is highlighted in IDEA) as ‘strs’ has raw type and cant be converted without cast to Set.
    On the other hand code
    Set strs = new TreeSet((o1, o2) -> {
    return o2.compareToIgnoreCase(o1);
    compile but is highlighted in the IDE. Will investigate the problem. Thanks

  8. Anna Kozlova says:

    The font is default (Tahoma 11)

  9. JohnPaul says:

    public class MyClassTest extends TestCase {
    public void testFoo() {
    Comparable integerComparable = new Comparable() {
    public int compareTo(Integer o) {
    return 0;

    does not offer an intention.

    $ java -version
    openjdk version “1.8.0-ea”
    OpenJDK Runtime Environment (build 1.8.0-ea-lambda-nightly-h1171-20120911-b56-b00)
    OpenJDK Client VM (build 24.0-b21, mixed mode)

    Idea @IU-122.337

    Any ideas?

  10. Anna Kozlova says:

    Works here. Could you please check that your module has 1.8 language level. Otherwise IDEA would treat lambdas as unsupported feature, hence no intention would be suggested.

  11. Davide says:

    is there already also support for map, filter and reduce operations on collections? Looks great anyway! Great job.

  12. Anna Kozlova says:

    Davide, what support do you expect? Thanks

  13. David Turanski says:

    Re. Collections support. Basic lambda examples are working for me. When I tried to do something simple like List.forEach {} it doesn’t compile. It appears it’s not part of the latest jdk 8 build yet, but I may be missing something. Does this work today?

  14. Anna Kozlova says:

    To be sure you need to download java from

Leave a Reply

Your email address will not be published. Required fields are marked *