-1

我在 java 程序中运行 jess 时遇到错误,如错误:包 jess 不存在我不知道要包含什么和所有包。

我写过这样的代码:

import jess.*;
public class ExQuery {
    public static void main(String[] argv) throws JessException {
        Rete engine = new Rete();
        engine.batch("query.clp");
        engine.reset();

    QueryResult result =
        engine.runQueryStar("search-by-name", new ValueVector().add("Smith"));
    while (result.next()) {
        System.out.println(result.getString("fn") + " " + result.getString("ln")
                            + ", age" + result.getInt("age"));
    }
  }
}
4

1 回答 1

0

确保您已将 jess.jar 库导入到您的项目中。右键单击项目 -> 属性 -> 进入 Java 构建路径 -> 添加外部 JAR

您需要将 jess.jar 文件选择到您的 Jess71p2(或其他版本..) -> lib -> jess.jar

于 2014-04-03T15:12:13.470 回答