CHAPTER 10

image

The jjs Command-Line Tool

In this chapter, you will learn:

  • What the jjs command-line tool is
  • How to invoke the jjs command-line tool
  • How to pass arguments to the jjs command-line tool
  • How to use the jjs command-line tool in interactive and scripting mode

To work with the Nashorn script engine, JDK 8 includes a new command-line tool called jjs. If you wonder what jjs stands for, it stands for Java JavaScript. The command is located in the JDK_HOME\bin directory. The command can be used to run scripts in files or scripts entered on the command-line in interactive mode. It can also be used to execute shell scripts.

The Syntax

The syntax ...

Get Scripting in Java: Integrating with Groovy and JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.