最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Javascript engine can not be found - scripting for the Java platform - Stack Overflow

programmeradmin4浏览0评论

Recently some of my users have been reporting problems with NullPointers. Thanks to one of them, I have managed to find out that my application can't find the Javascript engine that should theoretically e with the JRE (most of them have the JDK anyway).

How can they manually install the scripting engine?

Thanks in advance...

P.S. Most of these people have OpenJDK. However, this doesn't happen to me (I am also an OpenJDK user)... EDIT: They have at least version 1.5, most of them have 1.6.

Recently some of my users have been reporting problems with NullPointers. Thanks to one of them, I have managed to find out that my application can't find the Javascript engine that should theoretically e with the JRE (most of them have the JDK anyway).

How can they manually install the scripting engine?

Thanks in advance...

P.S. Most of these people have OpenJDK. However, this doesn't happen to me (I am also an OpenJDK user)... EDIT: They have at least version 1.5, most of them have 1.6.

Share Improve this question edited May 22, 2011 at 18:17 nickguletskii asked May 22, 2011 at 18:05 nickguletskiinickguletskii 3024 silver badges10 bronze badges 3
  • What JDK version do they have? The Rhino stuff has only been there since 1.5. – Pointy Commented May 22, 2011 at 18:08
  • They have 1.5 or up, most of them have 1.6. – nickguletskii Commented May 22, 2011 at 18:14
  • Ah well oops - it's 1.6, not 1.5, that introduced Rhino. – Pointy Commented May 22, 2011 at 18:46
Add a ment  | 

2 Answers 2

Reset to default 4

From JSR 270 (the Java 6 SE spec):

There will be no requirement that any particular scripting language be supported by the platform; implementors may choose to include support for the scripting language(s) of their choice as they see fit.

So, it is conceivable that there are JREs out there without JavaScript support. There may also be variations in engine names, language names and versions bundled. "JavaScript" is an Oracle trademark so some vendors might be reluctant to use it as an identifier string.

The Rhino engine has only been bundled with Java since Java 6. Thus, your Java 5/1.5 users won't have it preinstalled.

That said, you can get Rhino, the Javascript engine, manually from Mozilla's site, since the engine itself does work with Java 5. However, you will have to use Rhino's API, rather than working with Java's ScriptEngine interface.

发布评论

评论列表(0)

  1. 暂无评论