My java application which is packaged with java 7 gave the following stack trace on a customers computer. It seems to be trying to use a Java 8 new Javascript engine even though it is definently running Java 7, any ideas ?
java.lang.NoClassDefFoundError: Could not initialize class jdk.nashorn.internal.objects.Global
at jdk.nashorn.internal.runtime.Context.newGlobal(Context.java:778)
at jdk.nashorn.api.scripting.NashornScriptEngine$3.run(NashornScriptEngine.java:425)
at jdk.nashorn.api.scripting.NashornScriptEngine$3.run(NashornScriptEngine.java:421)
at java.security.AccessController.doPrivileged(Native Method)
at jdk.nashorn.api.scripting.NashornScriptEngine.createNashornGlobal(NashornScriptEngine.java:421)
at jdk.nashorn.api.scripting.NashornScriptEngine.<init>(NashornScriptEngine.java:181)
at jdk.nashorn.api.scripting.NashornScriptEngine.<init>(NashornScriptEngine.java:152)
at jdk.nashorn.api.scripting.NashornScriptEngineFactory.getScriptEngine(NashornScriptEngineFactory.java:141)
at javax.script.ScriptEngineManager.getEngineByName(Unknown Source)
I dont know if he has Java 8 installed (butIve asked) but I do know he is actually using Java 7 to run the application because an automatic check and log I do at startup. which gives
18/02/2014 21.47.09:com.jthink.songkong.cmdline.SongKong:writeSystemInfo:INFO: SongKong 1.17.0 using Java 1.7.0_45 24.45-b08 32bit on Windows 7 6.1 x86 initialized successfully
The failing code is simply:
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("JavaScript");