Skip to content

The nashorn is being used but not included in java 15+ #911

Open
@ali-v-1985

Description

@ali-v-1985

In the handlebars.java 4.3.0 the problem with java 15+ supposed to be solved but the code below is still trying to get instance of nashorn script engine, which is not included in jdk any more.

this.engine = new ScriptEngineManager().getEngineByName("nashorn");

The code is being referenced via the registerHelpers method of Handlebars when a js file is being used as the helper source.

Here is the pull request which addressed the issue
#867

The following is the stacktrace which resulted by calling registerHelpers method.

java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.put(String, Object)" because "this.engine" is null
  
  at com.github.jknack.handlebars.helper.DefaultHelperRegistry.engine(DefaultHelperRegistry.java:304)
  at com.github.jknack.handlebars.helper.DefaultHelperRegistry.registerHelpers(DefaultHelperRegistry.java:193)
  at com.github.jknack.handlebars.helper.DefaultHelperRegistry.registerHelpers(DefaultHelperRegistry.java:173)
  at com.github.jknack.handlebars.Handlebars.registerHelpers(Handlebars.java:750)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions