4

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");

1 Answers1

1

This error was encountered when a project was cloned from the code cloud when it was running. This part of the content is about the loading of the verification code. I did not understand the reason but it was a version problem. Change the JDK version from The problem is solved when 13 is reduced to 8.

Gayan Chinthaka
  • 521
  • 6
  • 5