创建可部署的JRuby JAR文件? [英] Create deployable JRuby JAR file?

查看:72
本文介绍了创建可部署的JRuby JAR文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将我的JRuby应用程序编译成一个独立的JAR文件.我该怎么办?

I need to compile my JRuby application into a standalone JAR file. How can I do this?

推荐答案

Warbler 1.3.0或更高版本也可以用于制作可执行的JAR文件.

Warbler 1.3.0 or newer can also be used to make an executable JAR file.

快速说明.确保您在这里使用JRuby的gem等.

Quick instructions. Make sure you're using JRuby`s gem, etc. here:

$ gem install warbler
$ mkdir bin
$ cat <<EOF > bin/myapp
#!/usr/bin/env jruby

puts "Hello World"

EOF
$ chmod a+x bin/myapp
$ warble jar

您现在应该在当前目录中有一个myapp.jar文件.根据README,您只需在lib目录中添加所需的所有库,然后使用.gemspecGemfile(或同时使用).gemspecGemfile来控制需要放入.jar文件中的任何其他gem.

You should now have a myapp.jar file in the current directory. According to the README you just add any libraries you need in the lib directory and use either (or both) a .gemspec or Gemfile to control any other gems that need to be put into the .jar file.

这篇关于创建可部署的JRuby JAR文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆