Nashorn has been deprecated unfortunately, as there were lots of examples.

We understand that GraalVM can compile and run applications. We dont need this.

We just want to run some javascript in our java apps. Load a javascript file, then call methods on it periodically, and have javascript call java in response. The javascript is an engine we need to be able to run in the browser client or on the server.

Has anyone seen a way to use GraalVM to run js files in a spring app, or better, grails? We use gradle. 

To be clear, we dont want to use graalvm to compile our application. We only want a utility which can run js inside our existing applications.

Examples and documentation are thin on the ground. There don't seem to be any gradle plugins or options to support it either.

Or should we stick with Nashorn?