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

查看:166
本文介绍了找不到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?

提前致谢...

PS这些人大多数都有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.

推荐答案

来自 JSR 270 (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天全站免登陆