Java ScriptEngine create

Description

Java ScriptEngine create

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

public class Main {
  public static void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    ScriptEngine engine = manager.getEngineByName("JavaScript");
    if (engine == null) {
      System.out.println("JavaScript engine is not available. ");

      return;/*  w ww  .j a va2 s  .  c  om*/
    }
  }
}



PreviousNext

Related