Question

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!

Was it helpful?

Solution

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.

OTHER TIPS

According to the Warbler bug you refer to, the fix has been merged, but it looks like no gem has been released since.

I suggest you try building a latest warbler gem from the github source, as per this question

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top