Skip to content

Instantly share code, notes, and snippets.

@h4wkst3r h4wkst3r/nashornFromJava.java Secret
Last active Aug 15, 2018

Embed
What would you like to do?
Example invoking Nashorn Javascript Engine from Java
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class test {
public static void main(String[] args) throws ScriptException {
// initialize nashorn scripting engine
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine nashorn = manager.getEngineByName("nashorn");
nashorn.eval("print('TEST')");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.