As I move my project to java7, Drools starts throwing a RuntimeDroolsException during the init process. When I dig further, I found that this happens when it checks the java dialogs.
The problem is this: Drools 5.1.1 compares the java.version system property with LANGUAGE_LEVELS to check it. LANGUAGE_LEVELS is a hard-coded list of java versions up to 1.6
In org.drools.rule.builder.dialect.java.JavaDialectConfiguration, public static final String[] LANGUAGE_LEVELS = new String[]{"1.5", "1.6"};
I did not want to change the source code. So I added the following as a workaround to get around the Java dialect check.
Properties properties = new Properties(); properties.setProperty( "drools.dialect.java.compiler.lnglevel","1.6" ); PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( properties ); KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(cfg);
Is there a better way to do this other than editing the source code?
PS: Drools 5.1.1 - the latest production version of drool
source share