简体   繁体   中英

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" . 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. 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:

The syntax of a JAR URL is:

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  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM