The reason we are using Rhino is:
- We don't yet have the resources to port to Nashorn.
- We might want to support Java 7 in the future.
- Having the JS engine as a separate Jar helps sandboxing it. (If Nashorn is loaded by the system class loader, as I suspect it is, it won't be possible to sandbox it).
- Nashorn seems to add some bindings to the global scope with no way to turn it off. (This is from vague memory; I had brought this up on the Nashorn mailing list about an year back and was told that this behavior won't be changed).
Instead, Nashorn is aimed at these two purposes:
Web-K is a basic web view which integrates Flying Saucer as a renderer, JSoup as parser and Nashorn as JS runtime with basic DOM-related features.