O'Reilly logo

Scripting in Java: Integrating with Groovy and JavaScript by Kishori Sharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 12

image

Java APIs for Nashorn

In this chapter, you will learn:

  • What Java APIs for Nashorn are
  • How to instantiate the Nashorn engine directly
  • How to pass options to the Nashorn engine in Java code and on the command-line
  • How to share globals among script contexts in a Nashorn engine
  • How to add, update, delete, and read properties of script objects in Java code
  • How to create script objects and invoke their methods in Java code
  • How to invoke script functions from Java code
  • How to convert script dates to Java dates

What Are Java APIs for Nashorn?

It is straightforward to use Java classes in Nashorn scripts. Sometimes you may want to use Nashorn ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required