简体   繁体   English

如何在Eclipse中将Rhino项目构建为可运行的JAR?

[英]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.

相关问题 如何在Eclipse中构建Java项目以创建外部JAR - How do I build a Java project in Eclipse, to create an external JAR 如何在Eclipse中创建可运行的JAR,就像在Eclipse中一样 - How do I create a runnable JAR in IntelliJ as I would in Eclipse 将Eclipse项目导出到Runnable Jar - Exporting Eclipse Project to Runnable Jar 将带有jar文件的Eclipse项目导出到可运行的jar中 - Exporting an Eclipse project with jar file into a runnable jar 如何使用hibernate配置为maven eclipse项目制作runnable jar文件 - How to make the runnable jar file for a maven eclipse project with hibernate configuration 如何从Eclipse中为javaCV或openCV项目制作可运行jar - how to make runnable jar for javaCV or openCV project from Eclipse 如何使用 Maven 项目中 Eclipse 中的资源创建可运行的 jar - How to create runnable jar with resources in Eclipse from Maven project How do I build a Java Github Project in Eclipse with no maven &amp; gradle files and no.jar files in the repo - How do I build a Java Github Project in Eclipse with no maven & gradle files and no .jar files in the repo 我在eclipse上有一个程序,并将其导出为可运行的JAR文件,如何双击运行它? - I have a program on eclipse and exported it as a runnable JAR file, how do I run it on a double click? 如何正确导出可运行的 jar? - How do I properly export a runnable jar?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM