javajavascriptscriptengine

How to make ScriptEngine to run multiple javascript files?


I have 6 js files and I need to include them all into final script to pass ScriptEngine's eval method.How can I do it? ScriptEngine haven't add() method.I can read them with FileReader and than concatenate those strings but I think there will be a better way.


Solution

  • You can use the overload eval(Reader) to avoid having to load scripts into a String yourself.