import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; public class GetEngineByExtensionDemo { public static void main(String[] args) { ScriptEngineManager manager = new ScriptEngineManager(); /* Retrieve a ScriptEngine that supports scripts with .js extension */ ScriptEngine jsEngine = manager.getEngineByExtension("js"); System.out.println(jsEngine); } }