eclipsedroolsjboss-tools

Drools Eclipse Plugin ignores source level


I have installed the Drools Eclipse Plugin org.drools.eclipse 7.36.0.Final into my Eclipse 2020_03 running with a Oracle JDK 1.8.0_92. I have downloaded und unzipped drools-distribution-7.36.0.Final and added the binaries/ directory as Drools > Installed Drools Runtimes in the Eclipse Preferences.

As soon as I use any Java 1.5+ features (generics, foreach loops, closures, ...) I get error markers in the Rule Editor saying that there are syntax errors and those features require source level 1.5 (1.8 for closures).

My .drl files and the project itself seem to be fine, because I can compile and run via maven without errors. So it's not a blocking issue, but it's annoying that I cannot seem to get syntax checks for .drl files working properly in my IDE.

I have searched the internet and tried out all kinds of things:

<?xml version="1.0" encoding="UTF-8"?>
<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
    <configuration>
        <property key="drools.dialect.java.compiler.lnglevel" value="1.8" />
        <property key="drools.dialect.java.compiler" value="ECLIPSE" />
        <property key="drools.compiler.lnglevel" value="1.8" />
    </configuration>
    <kbase name="rules">
        <ksession name="codegen-rules"/>
    </kbase>
</kmodule>
drools.dialect.java.compiler.lnglevel=1.8
drools.dialect.java.compiler=ECLIPSE
drools.compiler.lnglevel=1.8
-Ddrools.dialect.java.compiler.lnglevel=1.8
-Ddrools.dialect.java.compiler=ECLIPSE
-Ddrools.compiler.lnglevel=1.8

But all of these do not seem to have any effect and it keeps giving me the same error markers.

How can I tell the Rule Editor that I want to enable Java 1.8 source level when syntax checking my .drl files?


Solution

  • I have run into this issue as well using the latest eclipse release and the latest drools release.

    Using Eclipse 2019-03 and the Jboss Tools Integration Stack here does work. So either something broke in later eclipse releases or in the later drools versions. The integration stack uses 7.21.0.Final

    I have not dug into what exactly broke but even if I did I don't know who I would report it to :(