title: How to set java-8 Nashorn javascript engine options for a single engine instance
body: <p>I have read that Nashorn supports some options but it seems <a href="http://cr.openjdk.java.net/~sundar/8020015/webrev.01/src/jdk/nashorn/internal/runtime/resources/Options.properties.html" rel="nofollow">all of them are undocumented</a>.</p>
  
  <p>They can be used by setting system properties but they are global. I want to set them programmatically for a single engine instance.</p>
  
  <p><a href="https://wiki.openjdk.java.net/display/Nashorn/Nashorn+jsr223+engine+notes" rel="nofollow">Here you can read</a> it is possible to specify options the way I want but that classes are internal so I get this kind of error:</p>
  
  <pre><code>"Access restriction: The type NashornScriptEngineFactory is not accessible due to restriction on required library C:\Program Files\Java\jdk1.8.0\jre\lib\ext\nashorn.jar".
  </code></pre>
  
  <p>I can't find a way to set those options with the java scripting API.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>It seems that the problem is eclipse protecting me from using internal classes and not exactly a problem using nashorn but I will concrete the question.</p>
  
  <p>Is there a way to setup the options of a single nashorn engine instance without using nashorn classes that are not part of the <a href="http://docs.oracle.com/javase/8/docs/api/javax/script/package-summary.html" rel="nofollow">javax.script API</a>?</p>