title: How to debug JavaScript program using Nashorn?
body: <p>I need to be able to Debug JS code run by Nashorn i.e:</p>
  
  <pre><code>ScriptEngineManager sem = new ScriptEngineManager();
  ScriptEngine engine = sem.getEngineByName("nashorn");
  engine.eval("load (\"src/com/sap/rdl/runjs/file.js\");");
  </code></pre>
  
  <p>Now I need to add a breakpoint in the JS file and be able to step through the lines programmatically (implement a debugger).</p>
  
  <p>I know intelliJ and NetBeans implemented this so it should be possible, yet I cannot find any API in Nashorn that allows stepping and/or mapping of lines or variables.</p>
  
  <p>Any advice/links would be most welcome.
  Thanks in advance.</p>