Listing All Available Script Engines - Java Scripting

Java examples for Scripting:Script Engines

Description

Listing All Available Script Engines

Demo Code

import java.util.List;
import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;

public class Main {
  public static void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    List<ScriptEngineFactory> list = manager.getEngineFactories();
    for (ScriptEngineFactory f : list) {
      System.out.println("Engine Name:" + f.getEngineName());
      System.out.println("Engine Version:" +
        f.getEngineVersion());//from w  ww . java 2 s .co m
      System.out.println("Language Name:" + f.getLanguageName());
      System.out.println("Language Version:" +
        f.getLanguageVersion());
      System.out.println("Engine Short Names:" + f.getNames());
      System.out.println("Mime Types:" + f.getMimeTypes());
    }
  }
}

Result


Related Tutorials