News

Java SE 6 makes it simple to use JavaScript within Java code. Other scripting engines can also be associated with Java, but it is handy to have one provided out-of-the-box with Mozilla Rhino.
To call Nashorn JavaScript from a Java 8 program, you basically need to make a new ScriptEngineManager instance and use that ScriptEngineManager to load the Nashorn script engine by name.
With JDK 8 Java adds full JavaScript support plus some awesome extensions with Project Nashorn. In this article JavaScript expert Oliver Zeigermann explains the hows and the why's.
Obligatory rant: JavaScript may have Java as part of its name, but the two languages are very different in spirit and design, as well as in their implementations.