On 06/04/2010, sebb <seb...@gmail.com> wrote: > On 04/04/2010, Stefan Bodewig <bode...@apache.org> wrote: > > On 2010-04-03, Brett Randall <javabr...@gmail.com> wrote: > > > > > What's the correct fix here - is there an option to ask Gump to build > > > BSF with JDK5, > > > > > > Unfortunately there isn't. Gump in its current state is unable to use > > different JDKs even though it sometimes would be desirable (like when > > the JCP decides to break well known interfaces). > > > However, I don't think that is the case here - the test code ought to > work on Java 1.6 too. > > I'm hoping to take a look at the problem soon. >
The problem seems to be that the default "js" engine factory provided with Java 1.6 does not behave in the same way as the downloaded engine which is always used in Java 1.4/1.5. Oddly, the engine that is returned can vary between runs and between calls to setup. The factory that works is: [com.sun.phobos.script.javascript.RhinoScriptEngineFactory] Mozilla Rhino 1.6R7 for ECMAScript 1.6 The factory that does not work is: [com.sun.script.javascript.RhinoScriptEngineFactory] Mozilla Rhino 1.6 release 2 for ECMAScript 1.6 It looks like both engine factories are registered for the "js" extension, but the one that is returned varies. One solution would be to use manager.getEngineByName("rhino-nonjdk") because the factory that works supports that and the default factory in 1.6 does not. However, that may be cheating. It's a pity that the ScriptEngineManager interface does not support versioning so the code could look for at least 1.6R7. > > > > Stefan > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: bsf-dev-unsubscr...@jakarta.apache.org > > For additional commands, e-mail: bsf-dev-h...@jakarta.apache.org > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: bsf-dev-unsubscr...@jakarta.apache.org For additional commands, e-mail: bsf-dev-h...@jakarta.apache.org