无法找到 Javascript 引擎 - 为 Java 平台编写脚本 [英] Javascript engine can not be found - scripting for the Java platform

查看:25
本文介绍了无法找到 Javascript 引擎 - 为 Java 平台编写脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我的一些用户报告了 NullPointers 的问题.感谢其中之一,我设法发现我的应用程序无法找到理论上应该与 JRE 一起提供的 Javascript 引擎(无论如何,它们中的大多数都有 JDK).

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 come with the JRE (most of them have the JDK anyway).

他们如何手动安装脚本引擎?

How can they manually install the scripting engine?

提前致谢...

附言这些人中的大多数都拥有 OpenJDK.但是,这不会发生在我身上(我也是 OpenJDK 用户)...他们至少有 1.5 版,大多数有 1.6 版.

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

推荐答案

来自 JSR270(Java 6 SE 规范):

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.

因此,可以想象存在不支持 JavaScript 的 JRE.捆绑的引擎名称、语言名称和版本也可能有所不同.JavaScript"是 Oracle 的商标,因此某些供应商可能不愿意将其用作标识符字符串.

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.

这篇关于无法找到 Javascript 引擎 - 为 Java 平台编写脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆