Search code examples
java-8playframework-2.4typesafe-activator

error: illegal start of expression in some lambda expressions


I have the following function in java:

private static Predicate<SomeObject> isNotCancelled() {
    return i -> !i.getStatus().equals("Cancelled");
}

When using the following activator commands: compile, run, test or testOnly. Everything works well, no compilation error and the app works just as I expected.

But when I do activator testProd or activator stage the following error occurs:

[error] /path_to_class/SomeClass.java:34: error: illegal start of expression
[error]         return i -> !i.getStatus().equals("Cancelled")
[error]                   ^

Can someone help me understanding why this is happening?

Thanks in advance.


Solution

  • I solved this issue by upgrading activator, sbt and play versions to:

    • activator-dist-1.3.7 (My previous version was 1.3.6)
    • sbt 0.13.9 (My previous version was 0.13.8)
    • play 2.4.4 (My previous version was 2.4.4)