在java程序中运行jess时出错。

时间:2014-03-18 08:49:10

标签: java jess

我在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"));
    }
  }
}

1 个答案:

答案 0 :(得分:0)

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

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