I want to try out RoR using Ruby code that draws upon existing Java libraries. Ruby can load Java libraries, no? If this is so, what advantage does JRuby offer over Ruby if Ruby promises to load Java libraries?
I ask because my reflex inclination is to use JRuby or Groovy or something "closer" to Java, just to be safe. But perhaps this is irrational thinking.
It seems to be possible to do this using the Ruby Java Bridge. I haven't used it and can't say much about it. I'm guessing it was more important before JRuby was able to run Rails - if you wanted Java libraries from RoR applications, you needed RJB. Nowadays you can probably use JRuby on Rails instead. I'm guessing that would be better, based only on the limited number of articles I see about RJB - most all of which seem to predate the release of JRuby 1.0. But there may be some cases where JRuby limitations force the user to use C-Ruby, in which case RJB still offers a path to use Java classes.
There's also YAJB (Yet Another Java Bridge), about which I could find even less. Some people apparently had troubles getting this to work, apparently, and it hasn't been updated in a couple years, so I'd be a bit suspicious.
Googling "jruby rjb yajb" (or any two out of those three) yields assorted articles that may be of interest. That's where my limited knowledge comes from; I didn't spend long at it.
"I'm not back." - Bill Harding, Twister
Joined: Apr 08, 2003
Thanks, you guys--I think I had it wrong. It makes pretty clear sense to use JRuby if you want to call java libraries.