Java 6 是否包含可以运行 javax.script (Rhino JS) 文件的程序?
我发现 Java 6 包含 Rhino JS(除了一两个小部分),如 javax.script
。很酷!
Java 6 安装(JRE 或 JDK)是否包含一个二进制文件,我可以简单地指向 .js 文件来运行? (我认为如果能够提供源代码供其他人阅读和运行,无需编译,并且只需要安装 Java,那就太好了。)或者我是否必须构建这个小 8 行程序 在文档中?
I found that Java 6 includes Rhino JS (except for one or two minor pieces), as javax.script
. Pretty cool!
Does a Java 6 install (JRE or JDK, either) contain a binary that I can simply point to a .js file to run? (I think it would be great to be able to provide source code for others to read and run, without compilation, and require only that Java be installed.) Or do I have to build the little 8-line program in the docs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,有 jrunscript
Yes, There's jrunscript
JDK 中包含一个名为 jrunscript:
There's a binary included in the JDK called jrunscript:
在基于 Debian 的系统上,您可以安装 Rhino 软件包并访问名为
js
的控制台应用程序。从那里,您可以让所有 js 文件以:开头,并将脚本设置为可执行文件以直接运行它们。
On Debian based systems, you can install the Rhino package and access a console application called
js
. From there, you can have all your js files begin with:and set the script to executable to run them directly.