Nothing, probably.
I and others have also run into the "no such file to load" exception.
I've done some work to fix this by adjusting the value of $LOAD_PATH by
parsing values out of build_configuration.rb for src and lib folders,
and this has worked for trivial examples. I have not tested it for
anything complex (though, offhand, I don't see why it wouldn't).
I will try to push something in the next few days so at least people can
try the current repo code to see if it works for them.
James
Path handling appears to have changed.
>
> Do you (or any lurkers on the list) have a small example that *does work* u=
> nder recent JRuby releases? I'd like one even if I have to do some local pa=
> tching or messing around to get it to work. I have a deployment coming up w=
> ithin the next 2 weeks that could benefit from a rawr-like bundling. My end=
> users aren't exactly computer geniuses so I was hoping to provide them wit=
> h double-clickable EXEs. :)
>
Here's a hack you can do in Main.java
Prior to the line that actuall tries to require you main Ruby file, add
this:
runtime.evalScriptlet( "$: << 'src/'" );
This assumes your main.rb or foo.rb or whatever is the entry point for
your app is in src/
Something like this
runtime.evalScriptlet( "$: << 'src/'" );
runtime.evalScriptlet("require '" + mainRubyFile + "'");
BTW, this page suggests that Main.java can be done away with:
http://www.jruby.org/apidocs/org/jruby/JarBootstrapMain.html
but I've not tried anything yet.
James
That's unusual. I'm using JRuby 1.6.3, so maybe the 1.6x releases are a bit less compatible with rawr than the 1.5x series?
Do you (or any lurkers on the list) have a small example that *does work* under recent JRuby releases? I'd like one even if I have to do some local patching or messing around to get it to work. I have a deployment coming up within the next 2 weeks that could benefit from a rawr-like bundling. My end users aren't exactly computer geniuses so I was hoping to provide them with double-clickable EXEs. :)
cr
>
> Here's a hack you can do in Main.java
>
> Prior to the line that actuall tries to require you main Ruby file, add this:
>
>
> runtime.evalScriptlet( "$: << 'src/'" );
>
> This assumes your main.rb or foo.rb or whatever is the entry point for your app is in src/
Okay, this worked. I was able to regenerate the jar and run it as "java -jar /path/to/jar" successfully. Thank you for the fix/hack!
I will take a look at patching rawr so that the *.java file it produces has the right LOAD_PATH set so we can avoid this manual hack. I'll send a pull request if I get it working.
cr
I've spent a few hours looking at how to add in the ability for Creator#create_java_main_file to add the ruby source directories to the LOAD_PATH, but I haven't had any luck. It looks like I should just be able to modify rawr_main.rb to pass +current_options+ to the call to ::Rawr::Create.create_java_main_file() but I can't get a spec working or that idea working. :(
I'll use the hack for now.
cr
I have code that reads values from build_configuration.rb and dynamically primes the load path. What I posted was an excerpt to allow a cheap hack, but it's not how the proper code works.
I will be pushing that today or tomorrow; I'm traveling at the moment.
Chuck Remes <cremes....@mac.com> wrote:
>--
>You received this message because you are subscribed to the Google Groups "rawr-lib" group.
>To post to this group, send email to rawr...@googlegroups.com.
>To unsubscribe from this group, send email to rawr-lib+u...@googlegroups.com.
>For more options, visit this group at http://groups.google.com/group/rawr-lib?hl=en.
>