3

我正在尝试运行Drools示例(创建新 Drools 项目时的 HelloWorld 示例),我没有更改项目中的任何内容,但出现错误。

这是堆栈跟踪:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule.builder.dialect.java.JavaDialectConfiguration'
    at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:321)
    at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:307)
    at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:192)
    at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:170)
    at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:300)
    at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:228)
    at org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilder(KnowledgeBuilderFactoryServiceImpl.java:34)
    at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:46)
    at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:39)
    at com.sample.DroolsTest.main(DroolsTest.java:23)
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:100)
    at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:61)
    at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:317)
    ... 9 more

我在 Eclipse IDE 中运行项目

4

3 回答 3

8

就像 Sid 说的,这个 jar 在你的 eclipse 插件目录中。对于我的 windows 框,这是 C:\Program Files\eclipse\plugins\org.eclipse.jdt.core_3.8.2.v20120814-155456.jar

于 2013-09-18T18:19:19.353 回答
3

您可能需要将
eclipse 插件文件夹中的库 org.eclipse.core.jdt-version 添加到类路径中。

于 2013-09-17T00:39:40.897 回答
0

加上 Sid 和 Furrald 已经提到的内容。说的很明显,但是如果有人想知道在哪里可以找到 Linux 上 JBoss Dev Studio 的 jar:我在

<path-to-devStudio>/devstudio/studio/plugins/<name-and-version-of-jdt-core>.jar
于 2018-01-10T22:25:41.013 回答