I had the same problem and solved it like this after going through the source code:

        Properties props = new Properties();
        props.setProperty("drools.dialect.java.compiler", "JANINO");
        KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(props, null);
        KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(config);

Yours,
Olli


On Thu, Dec 31, 2009 at 5:57 PM, Martin Smith <msmith999999@gmail.com> wrote:
Hi folks,

I'm doing some very basic evaluation of Drools and can't get past the
first hurdle - the hello world example. I get this:

......
Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not
in the classpath
      at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:94)
      at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:55)
      at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270)

I'm not using Eclipse, my IDE is netbeans 6.8. I get the same error
running the compiled jar from outside netbeans as well so I don't
think it's related to the IDE.

I modified the example by adding a knowledge builder config and then this:

kconfig.setProperty("drools.dialect.java.compiler", "JANINO");

This had no effect. I rewrote the example to use a package builder and
set the compiler property on it to JANINO. Again, it didn't work. I
also tried passing a -Dproperty with the same thing. Again, no effect.

I have the janino jar from the download on the classpath along with
the other jars it says are necessary.

It works if I download and add the eclipse jar to the classpath but I
don't want to do this as I don't want my runtime app to depend on
pieces of eclipse.

I'm out of time and ideas now so asking for help here. These are the
drools related jars I have in the project:

antlr-runtime-3.1.1.jar
drools-api-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar
joda-time-1.6.jar
mvel2-2.0.10.jar
janino-2.5.15.jar
xstream-1.3.1.jar

Thanks,

Martin
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users