1

The code below cannot be compiled due to 'cannot find symbol symbol: class aNewRulesEngine location: class org.jeasy.rules.core.RulesEngineBuilder'

However, judging by this tutorial https://github.com/j-easy/easy-rules/wiki/fizz-buzz it should be fine.

Any ideas why does it goes sour?

import org.jeasy.rules.api.RulesEngine;
import org.jeasy.rules.core.RulesEngineBuilder;

public class Main {

    public static void main(String[] args) {
        RulesEngine rulesEngine = new RulesEngineBuilder.aNewRulesEngine();
    }
}
Mahmoud Ben Hassine
  • 28,519
  • 3
  • 32
  • 50
Adam
  • 842
  • 2
  • 14
  • 22

1 Answers1

3

aNewRulesEngine is a static method in RulesEngineBuilder (according to the documentation: https://github.com/j-easy/easy-rules/blob/master/easy-rules-core/src/main/java/org/jeasy/rules/core/RulesEngineBuilder.java) - but in your code sample, you are also trying to instantiate an instance for RulesEngineBuilder.

Perhaps this code will work better:

import org.jeasy.rules.api.RulesEngine;
import org.jeasy.rules.core.RulesEngineBuilder;

public class Main {

    public static void main(String[] args) {
        RulesEngine rulesEngine = RulesEngineBuilder.aNewRulesEngine();
    }
}
Assafs
  • 3,257
  • 4
  • 26
  • 39