Make sure that test.js is loaded via URLReader or load primitive. i.e.,
nashorn engine should load the script pointed via URL - if you pass
FileReader or loaded content to engine.eval, Nashorn will treat it as
sandboxed - i.e., script loaded from untrusted source. If it still does
not work for you, please post a test case here and/or file a bug with a
test.
-Sundar
On 11/07/18, 5:25 AM, Krueger, Simon wrote:
I cannot get the example at
https://wiki.openjdk.java.net/display/Nashorn/Nashorn+script+security+permissions
to work. Specifically, I cannot seem to get the permissions for the test.js to
apply. The permissions of the .jar that loads the test.js will work. This seems
to be a bug. Can anyone else verify if it is working for them or not?
Simon