0

我是流口水规划器的新手,并尝试使用 runExamples.bat 运行示例,但是当尝试在 exclipse 中导入该示例并尝试运行以下异常时

Exception in thread "main" java.lang.IllegalStateException: The directory dataDir (D:\OfficeWork\Eclipse_work\Cloudbalancing2\data\cloudbalancing) does not exist. The working directory should be set to the directory that contains the data directory. This is different in a git clone (drools-planner/drools-planner-examples) and the release zip (examples).
    at org.drools.planner.examples.common.business.SolutionBusiness.updateDataDirs(SolutionBusiness.java:101)
    at org.drools.planner.examples.common.app.CommonApp.createSolutionBusiness(CommonApp.java:55)
    at org.drools.planner.examples.common.app.CommonApp.<init>(CommonApp.java:35)
    at org.drools.planner.examples.cloudbalancing.app.CloudBalancingApp.<init>(CloudBalancingApp.java:27)
    at org.drools.planner.examples.cloudbalancing.app.CloudBalancingApp.main(CloudBalancingApp.java:33)
4

1 回答 1

1

对于 OptaPlanner 6.0.0.CR4,我使异常消息更清晰:

java.lang.IllegalStateException: The directory dataDir (...) does not exist.
 The working directory should be set to the directory that contains the data directory (which is not the data directory itself).
 The working directory is different in a git clone (optaplanner/optaplanner-examples) and the release zip (examples).
 In an IDE (IntelliJ, Eclipse, NetBeans), open the "Run configuration" to change the field "Working directory".

至于你的第二个问题:

你在使用 eclipse drools 插件吗?尝试禁用它。该 DRL 很好,但 eclipse drools 插件可能会错误地将其标记为错误。请注意,Eclipse 实际上并不编译 DRL,因此启用 eclipse drools 插件的唯一优势是 DRL 中的语法着色。

于 2013-09-24T07:38:46.997 回答