创建可部署的JRuby JAR文件? [英] Create deployable JRuby JAR file?
问题描述
我需要将我的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
目录中添加所需的所有库,然后使用.gemspec
或Gemfile
(或同时使用).gemspec
或Gemfile
来控制需要放入.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屋!