我正在尝试运行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中运行该项目
答案 0 :(得分:8)
就像Sid所说,jar在你的eclipse插件目录中。对于我的Windows框,这是C:\ Program Files \ eclipse \ plugins \ org.eclipse.jdt.core_3.8.2.v20120814-155456.jar
答案 1 :(得分:3)
您可能需要添加您所在的库org.eclipse.core.jdt-version eclipse将文件夹插入到类路径中。
答案 2 :(得分:0)
添加Sid和Furrald已经提到过的内容。 说明一个显而易见的,但如果有人想知道他们可以在Linux上找到JBoss Dev Studio的jar:我在
<path-to-devStudio>/devstudio/studio/plugins/<name-and-version-of-jdt-core>.jar