Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to Execute Scripts from Java Programs

Java: How to Execute Scripts from Java Programs
{filelink=958}

import javax.script.ScriptEngineManager;
import javax.script.ScriptEngine;
import javax.script.ScriptException;
public class ScriptExecution
 {
  public static void main(String[] args) throws ScriptException {
    ScriptEngineManager manager = new ScriptEngineManager();
    ScriptEngine jsEngine = manager.getEngineByExtension("js");
    jsEngine.eval("print (' Java run javascript')");
  }
}

No comments yet.

Leave a Comment