I am looking to incorporate JavaScript into one of my Java applications. In order to test this, I executed the following code:
javax.script.ScriptEngineManager manager = new ScriptEngineManager();
javax.script.ScriptEngine engine = manager.getEngineByName("JavaScript");
System.out.println(engine);
javax.script.List<ScriptEngineFactory> factories = manager.getEngineFactories();
System.out.println(factories.isEmpty());
Outcome:
null
true
Based on these results, it seems that JavaScript is not enabled by default in the liberty profile. How can I go about activating it?