Rectangle 27 0

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.

Well there are only really 3 possibilities:

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.

Sorry Ive now clarified that the application is being run using Java 7, Ive added log excerpt to confirm this. I'm not using java 8 simply because the prereleases have all done a funny things with installers not rendering gui button correctly, if this is fixed I would be happy to move to Java 8 but I don't understand why a Java 7 install is looking for Java 8 code.

They haven't come back to me (its a Windows 7 system actually). But I have tried out latest Java 8 and looks fine so will bundle Java 8 JRE and build with Java 8 JDK for next version hopefully that will solve his issue, thanks.

@RaviH - No it isn't. >>This<< question is about why Nashorn is being used on Java 7 at all. The OP doesn't want it. Or at least, that is my interpretation. He just wants a working Javascript engine ...

@StephenC In one plane that question itself answers - naive attempt to run Nashorn engine in Java 7 fails with the same error. Apparently Paul Taylor's customer getting this error has done that kind of naive attempt to run Nashorn under Java 7 by just including nashorn jar in classpath. If at all that person really needs to run nashorn under java 7, that person has to try the Java 7 backport as suggested in the answer to that post.

Java 7 application errors because trying to use new Java 8 Javascript ...

java javascript java-7 java-8 nashorn