"jrunscript" - Scripting Shell Command and Options

This section describes the scripting shell, 'jrunscript', command and options. The default scripting engine is JavaScript - ECMAScript 1.6 implementation 'Mozilla Rhino' 1.6 release 2.

After installing JDK on my machine, I want to get some help information on how to use the "jrunscript" command by running it with the "-help" option:

C:\herong>\progra~1\java\jdk-10.0.1\bin\jrunscript -help

Usage: jrunscript [options] [arguments...]

where [options] include:
 -classpath <path>    Specify where to find user class files
 -cp <path>           Specify where to find user class files
 -D<name>=<value>     Set a system property
 -J<flag>             Pass <flag> directly to the runtime system
 -l <language>        Use specified scripting language
 -e <script>          Evaluate given script
 -encoding <encoding> Specify character encoding used by script files
 -f <script file>     Evaluate given script file
 -f -                 Interactive mode, read script from standard 
                      input. If this is used, this should be the last
                      -f option
 -help                Print this usage message and exit
 -?                   Print this usage message and exit
 -q                   List all scripting engines available and exit

If [arguments..] are present and if no -e or -f option is used, then 
first argument is script file and the rest of the arguments, if any, 
are passed as script arguments. If [arguments..] and -e or -f option 
is used, then all [arguments..] are passed as script arguments. If 
[arguments..], -e, -f are missing, then interactive mode is used.

As the first test, I want to see what are the scripting engines supported by JDK by using the "-q" option:

C:\herong>\progra~1\java\jdk-10.0.1\bin\jrunscript -q

Language ECMAScript ECMA - 262 Edition 5.1 implementation 
"Oracle Nashorn" 10.0.1

Nice. My "jrunscript" command is working. There is only one default scripting engine: JavaScript - Language ECMAScript ECMA - 262 Edition 5.1 implementation "Oracle Nashorn" 10.0.1.

Here is the JDK's "jrunscript" JavaScript engine version history:

Table of Contents

 About This Book

 Introduction to JavaScript

 ECMAScript Language Specification and JavaScript Dialects

 Data Types, Variables and Expressions

 Flow Control Statements

 Creating, Accessing, and Manipulating Arrays

 Defining and Calling Functions

 Web Browser Supporting JavaScript

 Server-Side and Client-Side Web Scripting

 Introduction to Objects

 Defining Your Own Object Types

 Inheritance of Properties and Methods through the Prototype Object Chain

'jrunscript' - JavaScript Shell Command from JDK

 Downloading and Installing JDK 10

"jrunscript" - Scripting Shell Command and Options

 Running JavaScript Code with 'jrunscript'

 Evaluating JavaScript Code with 'jrunscript' Interactively

 Running a JavaScript Code File with 'jrunscript'

 Using Functions as "Function" Objects

 Introduction to Built-in Object Types

 W3C's Document Object Model (DOM) Specifications

 AJAX (Asynchronous JavaScript And XML)

 References

 Full Version in PDF/EPUB