Executing compiled script

In the previous posts under “Java Scripting”, we used ScriptEngine eval method to execute scripts stored in a string variable or file. The ScriptEngine’s eval methods takes the script compiles to intermediate code and execute it immediately. If we have a script which has to be executed repeatedly, then instead of compiling and executing it…… Continue reading Executing compiled script

Executing scripts written in a file using java

This post explain how to execute javascript code stored in a file. We create an instance of FileReader representing the physical file and pass it to eval method of an instance of ScriptEngine. Please refer to previous posts to know more about ScriptEngine and ScriptEngineManager The javascript code in the file that has to be…… Continue reading Executing scripts written in a file using java