I made some little programs with Swing-components in JRuby. Now I want to convert these to .jar-archives.
The first option I found is warbler: https://github.com/jruby/warbler Making a jar should be as simple as:
$ chmod a+x bin/mylittleprogram.rb
$ warble jar
But warble is aborted with an error: "can't modify frozen string" same issue as here: https://github.com/jruby/warbler/issues/76
I'm a newbie and, frankly speaking, I don't get from the thread at github what to do (like: look for x in file y and change it to z) to make it work. Like the guy who started the thread, I have an Ubuntu OS (11.04) und MRI and JRuby installed.
I also found rawr: http://rawr.rubyforge.org/ Making a jar should work as follows:
rawr install
rake rawr:jar
java -jar package/jar/your_jar_file.jar
In my case, I get an error:
Exception in thread "main" org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- main
My Question: Which of these two options will be easier to use? It would be also very helpful, to get an explanation what warbler and rawr do in the background.
Many thanks in advance!
Rawr is quite simpler for the standalone app. In your case, I guess you haven't specified the main class yet. You should check it on build_configuration.rb
# The main ruby file to invoke, minus the .rb extension
# default value: "main"
#
c.main_ruby_file = "hello"
where in my case, hello.rb is the main ruby file.