最近我的一些用户一直在报告 NullPointers 的问题。多亏了其中之一,我设法发现我的应用程序找不到理论上应该随 JRE 一起提供的 Javascript 引擎(无论如何它们中的大多数都有 JDK)。
他们如何手动安装脚本引擎?
提前致谢...
附言这些人中的大多数人都有 OpenJDK。但是,这不会发生在我身上(我也是 OpenJDK 用户)... 编辑:他们至少有 1.5 版,其中大部分有 1.6 版。
最佳答案
来自 JSR 270 (Java 6 SE 规范):
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.
因此,可以想象存在不支持 JavaScript 的 JRE。引擎名称、语言名称和捆绑版本也可能有所不同。 “JavaScript”是 Oracle 的商标,因此一些 vendor 可能不愿意将其用作标识符字符串。
关于找不到 Javascript 引擎 - 为 Java 平台编写脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6089773/