title: From Nashorn to Graaljs
body: <p>I would like to add the latest ECMAScript support to my java application. I currently use Java 8 with the Nashorn engine. How could I switch to Graaljs?</p>
  
  <p>this is the code I should translate:</p>
  
  <pre><code>import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
  private ScriptEngine engine;
  engine = new NashornScriptEngineFactory().getScriptEngine("-scripting");
  ...
  engine.setBindings(bindings, ScriptContext.GLOBAL_SCOPE);
  </code></pre>