views:

39

answers:

1

I am trying to use Rawr to turn a simple 3-file Ruby project into an executable jar to be run on Ubuntu. I ran jruby -S rawr install to create the Rakefile and set up the directory layout. All my .rb files are under the src directory at the root of the project. When I run jruby -S rake rawr:jar, it compiles all the Ruby files and creates the jar just fine. It then places it in my deploy directory along with lib/java/jruby-complete.jar.

I try executing the jar from inside deploy with java -jar hg_analyzer.jar. However, when I do this I am greeted with this error:

Exception in thread "main" <script>:1:in `require': Linkage error loading compiled script; you may need to recompile 'file:/home/marcw/Documents/hg_analyzer/deploy/jar/hg_analyzer.jar!/main.class': java.lang.NoClassDefFoundError: org/jruby/ast/executable/AbstractScript$RuntimeCache (LoadError)
    from <script>:1
    ...internal jruby stack elided...
    from Kernel.require(<script>:1)
    from (unknown).(unknown)(:1)

I've also tried running it as java -cp lib/java/** -jar hg_analyzer.jar, but to no avail. The Class-Path entry in the jar's manifest file looks okay as well. main.rb is the main Ruby file.

Running java with the -verbose option shows that it is finding the JRuby jar and is loading it from the expected location.

Any ideas?

A: 

Figured it out! The problem was that Rawr was downloading version 1.5 of the JRuby runtime and I have version 1.4 of the compiler on my system.

Marc W