[英]How do I build a Rhino project as a runnable JAR in Eclipse?
I have a Rhino project where I've written some .js files, and from Eclipse I start my program by calling org.mozilla.javascript.tools.shell.Main
with a parameter to one of my .js files, "src/bot.js"
. 我有一个Rhino项目,其中已经编写了一些.js文件,从Eclipse中,我通过调用
org.mozilla.javascript.tools.shell.Main
启动程序,该文件的参数指向我的一个.js文件"src/bot.js"
。 Now, in order to run this on my server I would like to be able to build it into a single runnable JAR for easy deployment. 现在,为了在我的服务器上运行它,我希望能够将其构建到单个可运行的JAR中,以便于部署。 How do I do this, or should I try to take on a totally different approach?
我该怎么做,还是应该尝试一种完全不同的方法?
The syntax to invoke a script is: 调用脚本的语法为:
java org.mozilla.javascript.tools.shell.Main [options] script-filename-or-url [script-arguments]
I have not tried it but in threory you should be able to pass in JAR URL as indicated below: 我还没有尝试过,但是在理论上,您应该能够按如下所示传递JAR URL:
The syntax of a JAR URL is: JAR URL的语法为:
jar:<url>!/{entry}
for example: 例如:
jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class
jar:file:/export/home/faculty/stansif/public_html/java/applets/image/view.jar!/image.gif
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.