Scripting in Java Tutorial - Scripting in Java Intro








A scripting language is a programming language that are interpreted by a runtime script engine.

The Java Scripting API can execute scripts written in any scripting language that can be compiled to Java bytecode.

JDK 6 and 7 shipped with a script engine called Rhino JavaScript engine. In JDK 8, the Rhino JavaScript engine has been replaced with a script engine called Nashorn.

Nashorn engine can be used in two ways:

  • be embedded into the JVM and invoked from the Java programs directly
  • be invoked from a command prompt using the jjs command-line tool.