I had a bit of a dig around ...
The javax.script.ScriptEngineManager
relies on a SPI mechanism to find and register ScriptEngineFactory
classes. Essentially, it trawls the classpath, looking for these classes. Apparently, in in your case, this has resulted in it finding NashornScriptEngineFactory
.
But why?
Well there are only really 3 possibilities:
You have a JAR file that includes Nashorn on your application's classpath.
You are using a JVM that includes Nashorn in one of its JAR files.
Someone has added the Nashorn in the Java installation's extensions directory.
To find out which, I suggest that you use find
to find all of the JAR files on the client system, then use jar tvf some.jar | grep Nashorn
to try to find which JAR is providing the Nashorn classes.