It seems that dialect configuration is not exposed yet through the drools-api. We need to do that.
   Would you please open a JIRA so that this is not lost?

   Meanwhile, the work around is to fallback to the previous API:

        JavaDialectConfiguration conf = (JavaDialectConfiguration) ((PackageBuilderConfiguration)knowledgeBuilderConfiguration).getDialectConfiguration( "java" );
        conf.setCompiler( JavaDialectConfiguration.JANINO );

   Finally, please remember that JANINO does not support java 1.6. >From his project page it supports java 1.4 with a few features from 1.5.



2009/7/2 Nicholas Hemley <>



I have a little test case as follows:


import org.drools.builder.KnowledgeBuilderConfiguration;

import org.drools.builder.KnowledgeBuilderFactory;

import org.junit.Assert;

import org.junit.Test;


public class TestDrools5Config {



      public void testConfig() {

            KnowledgeBuilderConfiguration knowledgeBuilderConfiguration = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();

            knowledgeBuilderConfiguration.setProperty("", "JANINO");

            knowledgeBuilderConfiguration.setProperty("", "1.6");


            String droolsDialectJavaCompiler = knowledgeBuilderConfiguration.getProperty("");

            System.out.println("droolsDialectJavaCompiler=" + droolsDialectJavaCompiler);



            String droolsDialectJavaLngLevel = knowledgeBuilderConfiguration.getProperty("");

            System.out.println("" + droolsDialectJavaLngLevel);





It fails.


I have seen the post for using JANINO with Drools:


Yet this does not explain my test case failing – any ideas.


It appears as if it is not possible to set JANINO programmatically, only via properties.conf, etc. which I don’t want to do(!)



Nic Hemley

rules-users mailing list

 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @