The Java API for scripting languages (JSR223) comes as standard in Java 1.6 and can be downloaded separately for Java 1.5 here.
My question is: are there any limitations or differences I should be aware of if using the separate download with 1.5 versus the native s开发者_开发知识库upport in 1.6?
I had been facing the same question earlier.
One difference might be the quality of script engines. Here's a response I got on jruby-user list:
I guess one of the reasons would be that current JRuby engine works on Java5 is not an official release. I put the archive for users' convenience. http://old.nabble.com/Call-for-discussion-about-embed-API-tp24528478p24981076.html :
Also:
I also know some class version problems were reported for Java5+JSR223+Jruby, but it works fine for me. http://old.nabble.com/Call-for-discussion-about-embed-API-tp24528478p25181920.html
I think these relate to ScriptEngines actually compiled under JDK5, see http://kenai.com/projects/jruby/pages/JavaIntegration#Java_6_(using_JSR_223:_Scripting)
That said, I haven't really run into these or other real problems on Java5 and JRuby - apart from the limitations of java.scripting API itself, but that's the same on Java6 I guess. (See that thread above as well).
So I think the benefit of Java6 -strictly from JSR223 point of view- would be better support and performance.
On the other hand, I did run into class loading problems with Java 6 with OSGI: I think it needs extra tweaks so that the JRE's built in discovery mechanism finds the ScriptEngines living in bundles.. (I might post another SO question about this :)
精彩评论