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

Invoking Java from Oracle Nashorn

In this recipe, we will look at calling Java APIs from the JavaScript code, including using the Java types, and dealing with package and class imports. There is a greater potential in combining the vastness of the Java API and the dynamic nature of JavaScript leveraged by the Oracle Nashorn JavaScript engine. We will look at creating a purely JavaScript code, which uses the Java APIs, and we'll use the jjs tool to execute this.

We will also look at creating a Swing-based application purely in 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