I am running Java's ScriptEngine class to run to some code. I use IntelliJ with maven dependencies when I run the code it says
Cannot invoke "javax.script.ScriptEngine.eval(String)" because "this.engine" is null
at Run.Evaluater.<init>(Evaluater.java:19)
the code at line being the following
engine.put("event", event);
engine.put("content", message);
This is how I initiated the ScriptEngone
public ScriptEngineManager man = new ScriptEngineManager();
public ScriptEngine engine = man.getEngineByName("nashorn");