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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.