Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.5.0.Final
    • Fix Version/s: None
    • Component/s: core engine
    • Labels:
      None
    • Sprint:
      2018 Week 05-06
    • Steps to Reproduce:
      Hide

      Create a default Drools kjar maven project.

      Create a rule containing the RHS statement:

      Arrays.asList("a","b","c").forEach(System.out::println);
      

      Build the project using mvn -package using Java 9.

      Show
      Create a default Drools kjar maven project. Create a rule containing the RHS statement: Arrays.asList( "a" , "b" , "c" ).forEach( System .out::println); Build the project using mvn -package using Java 9.
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      The Drools compiler class org.drools.compiler.rule.builder.dialect.java.JavaDialectConfiguration
      does not include Java 9 as a valid language level. Instead, when run using Java 9, the assumed java version is set to the default value of "1.7".

      As a consequence, when compiling a rules file requiring Java 8 specific language features, the compilation will fail. For example, if a rule RHS contains the statement:

      Arrays.asList("a","b","c").forEach(System.out::println);
      

      The rule compilation fails with the error:

      [ERROR] Unable to build KieBaseModel:default
      Rule Compilation error : [Rule name='test']
      	defaultpkg/Rule_test959974052.java (7:387) : Method references are allowed only at source level 1.8 or above
      

      The problem can be worked around by adding a configuration file META-INF/kie.properties.conf containing the line:

      drools.dialect.java.compiler.lnglevel = 1.8
      

      The Drools compiler code will use this value instead of the System "java.version" value, avoiding the problem.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  jkranes Jon Kranes
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: