Fixes #740, nashorn support. Thanks to @ceedriic for pointing out API calls needed.