O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

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

Introduction

Oracle Nashorn is the JavaScript engine developed for the Java platform. This was introduced in Java 8. Prior to Nashorn, the JavaScript engine for the Java platform was based on the Mozilla Rhino JavaScript engine. The Oracle Nashorn engine leverages the invokedynamic support introduced in Java 8 for better runtime performance, and also provides better compliance with the ECMAScript specification. 

Oracle Nashorn supports JavaScript code execution in a standalone mode using the jjs tool, as well as embedded in Java using its embedded scripting engine. In this chapter, we will look at executing the JavaScript code from Java and invoking the JavaScript function from Java, and vice versa, including accessing Java types from JavaScript. ...

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