Monkeybars - jar packaging

Hi,

I’ve been pulling my hair out, trying to package the most simple
HelloWorld example into a runnable jar.

Here’s what I get

---- SNIP -----
javac -target 1.6 -cp “lib/java/jruby-complete.jar:src:lib/ruby”
-sourcepath “src:lib/ruby” -d
“/Users/xx/Downloads/HelloMonkeybars/package/classes” “src/Hello.java”
javac -target 1.6 -cp “lib/java/jruby-complete.jar:src:lib/ruby”
-sourcepath “src:lib/ruby” -d
“/Users/xx/Downloads/HelloMonkeybars/package/classes”
“src/org/rubyforge/rawr/Main.java”
java -jar lib/java/jruby-complete.jar -e “require
‘/opt/local/share/java/jruby/lib/ruby/gems/1.8/gems/rawr-1.3.8/lib/jruby_batch_compiler’;
Rawr::JRubyBatchCompiler.compile_argv” src lib/ruby
/Users/xx/Downloads/HelloMonkeybars/package/classes
files for src: 8
files for lib/ruby: 0
Compiling src/application_controller.rb to class application_controller
Compiling src/application_view.rb to class application_view
Compiling src/main.rb to class main
Compiling src/manifest.rb to class manifest
Compiling src/resolver.rb to class resolver
Compiling src/greeter/greeter_controller.rb to class
greeter/greeter_controller
Compiling src/greeter/greeter_model.rb to class greeter/greeter_model
Compiling src/greeter/greeter_view.rb to class greeter/greeter_view
Copying non-source file Hello.form to
/Users/xx/Downloads/HelloMonkeybars/package/classes/Hello.form
=== Creating jar file:
/Users/xx/Downloads/HelloMonkeybars/package/jar/ChangeMe.jar
Feb 1, 2010 6:54:00 PM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Manifest-Version.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
Feb 1, 2010 6:54:00 PM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest: Main-Class.
Ensure that the manifest does not have duplicate entries, and
that blank lines separate individual sections in both your
manifest and in the META-INF/MANIFEST.MF entry in the jar file.
---- SNAP -----

Now here’s the funny part: The generated jar won’t launch, because it
can’t find monkeybars:

---- SNIP -----
01.02.10 18:56:03 [0x0-0xf60f6].com.apple.JarLauncher[2868]
src/manifest.rb:13:in `require’: no such file to load – monkeybars
(LoadError)
---- SNAP -----

… although it is installed and in PATH:

---- SNIP -----

echo $PATH
/opt/local/share/java/jruby/bin/:/opt/local/bin:/opt/local/sbin:/opt/local/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

jruby -S gem list

*** LOCAL GEMS ***

monkeybars (1.0.5)
rake (0.8.7)
rawr (1.3.8)
rspec (1.3.0, 1.2.9)
rubyzip (0.9.4)
sources (0.0.1)
---- SNAP -----

Any help would be really appreciated. I’ve been running against walls
for the last several days, trying to get any cross-platform GUI
toolkit to run on OS X 10.6 and JRuby/Swing/Monkeybars is really my last
resort before I have to give up Ruby for this project.

Oh, yes, and I’m running

OS X 10.6.2
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
java version “1.6.0_17”
Java™ SE Runtime Environment (build 1.6.0_17-b04-248-10M3025)
Java HotSpot™ 64-Bit Server VM (build 14.3-b01-101, mixed mode)

Thank you!

Tony

ahem, I meant to say

jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2010-02-01 6586) (Java
HotSpot™ 64-Bit Server VM 1.6.0_17) [x86_64-java]

Thanks!

On Mon, Feb 1, 2010 at 12:02 PM, Tony M. [email protected]
wrote:

Hi,

I’ve been pulling my hair out, trying to package the most simple
HelloWorld example into a runnable jar.

Here’s what I get
Now here’s the funny part: The generated jar won’t launch, because it
can’t find monkeybars:

Rawr should include MonkeyBars in the generated app/jar, and it
wouldn’t look on filesystem after that. Can you show us how you’re
running rawr and how it’s configured?

monkeybars (1.0.5)
rake (0.8.7)
rawr (1.3.8)
rspec (1.3.0, 1.2.9)
rubyzip (0.9.4)
sources (0.0.1)
---- SNAP -----

Yeah, I’m not sure this would matter to the rawr’ed application, since
it should be including monkeybars in the jar directly. Need more info
on how you’re doing the packaging…

Any help would be really appreciated. I’ve been running against walls
for the last several days, trying to get any cross-platform GUI
toolkit to run on OS X 10.6 and JRuby/Swing/Monkeybars is really my last
resort before I have to give up Ruby for this project.

Well, we’ll do our best to help :slight_smile:

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Have you checked monkeybars-1.0.4.jar (or similar) in lib/java.

Depending on how you packaged your gems in lib/ruby you may need to not
compile them. If you haven’t done it manually and renamed all the dirs
etc
(as per the wiki) you need to make sure that your required gems not
compiled
(c.compile_ruby_files = false in build_configuration.rb). If they are
compiled the paths get mangled and they wont be found.

I had some success using the new bundler gem to package my gems for
monkeybars (and not compiling gems).

P

On Mon, Feb 1, 2010 at 8:48 PM, Charles Oliver N.