


Scripting languages have some disadvantages as well.

A scripting language may provide domain-specific features that are not available in Java. They provide a quicker way to develop and test small applications. Using a scripting language in a Java application provides several advantages: Most scripting languages are dynamically typed, which makes it simpler to write programs. All classes and interfaces in the Java Scripting API are in the javax.script package. Support for scripting languages in Java comes through the Java Scripting API. The Java runtime and a scripting language runtime can communicate and make use of each other’s features. It also lets scripts access Java objects created by the host application. Java 6 added scripting support to the Java platform that lets a Java application execute scripts written in scripting languages such as Rhino JavaScript, Groovy, Jython, JRuby, Nashorn JavaScript, and so on. However, scripts written in some scripting languages may be compiled into Java bytecode that can be run by the JVM. Typically, unlike in a compiled programming language, the source code (called a script) in a scripting language is not compiled but is interpreted at runtime. The interpreter stores the variables used in a script in data structures called symbol tables. The interpreter parses the scripts, produces intermediate code, which is an internal representation of the program, and executes the intermediate code. A script is a sequence of characters that is written using the syntax of a scripting language and used as the source for a program executed by an interpreter. “scripting language is a programming language that provides you with the ability to write scripts that are evaluated (or interpreted) by a runtime environment called a script engine (or an interpreter).
