Why isn't Drools working with Java 8?

Looks like a bug in Drools (in the Eclipse compiler which is the default):

  • Bugzilla
  • JIRA (thanks Laune)

They're looking into fixing it in 6.1.0.Beta2.

Meanwhile, try this workaround: Override the ecj dependency to version 4.3.1.


I have solved this issue by edit pom in maven.

    <dependency>
        <groupId>org.eclipse.jdt.core.compiler</groupId>
        <artifactId>ecj</artifactId>
        <version>4.5.1</version>
    </dependency>

    <!-- core -->
    <dependency>
        <groupId>org.drools</groupId>
        <artifactId>drools-core</artifactId>
        <version>5.5.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.drools</groupId>
        <artifactId>drools-compiler</artifactId>
        <version>5.5.0.Final</version>
        <exclusions>
            <exclusion>
                <groupId>org.eclipse.jdt.core.compiler</groupId>
                <artifactId>ecj</artifactId>
            </exclusion>
        </exclusions>
    </dependency>