Using Nashorn Script Engine in AEM
Hi All,
I am currently working on AEM SP2 with JDK8 & trying to build a Handlebar Script Engine in AEM. For the Handlebar Compilation & processing we were loading the Nashorn Script Engine inside AEM & the Nashorn will be used to evaluate handlebars.js & other processing. I am loading the Nashorn engine as per instructions on http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html with below lines of code. But the nashorn Engine is not initializing.
ScriptEngineManager engineManager = new ScriptEngineManager(); ScriptEngine engine = engineManager.getEngineByName("nashorn");Another option which I tries was to Initialize ScriptEngineManager via OSGi @Reference Notation. When I do that It gives me all the Registered Script Engines in AEM available @ http://localhost:4502/system/console/status-slingscripting , but again Nashorn isn't among them.
Can anyone help me how to load Nashorn Engine inside AEM or do I have to do a Custom Implementation OF Nashorn Script Engine in AEM?
Thanks
Nitin