Background: The development of Nashorn started in late 2010 to experiment with the invokedynamic (JSR 292) byte-code instruction.
ScriptEngine engine = new ScriptEngineManager(). getEngineByName("nashorn"); engine.eval("print('Hello World');");
Initially, Nashorn found a home in a wide variety of applications, such as:
- app servers,
- JavaFX applications,
- shell scripts,
- embedded systems,
- and so on.
Nashorn continues to have broad usage, but its use appears to have settled into three main areas:
- Runtime adaptive or dynamic coding. The term I like to use is soft coding, where portions of an application can be modiied after the application/server is deployed. This capability is used for everything from stored procedures in databases to application coniguration management.
Nashorn vs V8
Documentation / Reference
- nashorn: Java Embedded Script Engine in Java 8