NullPointerException using org.jopendocument.dom.template.JavaScriptTemplate constructor

94 views
Skip to first unread message

Markus Voge

unread,
Jul 2, 2021, 6:09:34 PM7/2/21
to jOpenDocument

Running this code gives me a `Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.getBindings(int)" because "this.engine" is null`:

```
String filename = "Some_file.odt";
File infile = new File(filename);
JavaScriptTemplate template = new JavaScriptTemplate(infile);
```

This did not happen with earlier Java versions. I am now using the following Java: `openjdk version "15.0.2" 2021-01-19`.

Guillaume Maillard

unread,
Jul 2, 2021, 6:12:08 PM7/2/21
to jopend...@googlegroups.com
Hi Markus,

Oracle removed the Javascript engine in latest Java releases.
Just add :  https://github.com/openjdk/nashorn  to get it back.

Regards,
Guillaume

--

---
You received this message because you are subscribed to the Google Groups "jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jopendocumen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jopendocument/41a4c20a-2b75-4e84-922e-43fe260ab747n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages