This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
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.
subject: If Ruby can load java libraries, why use JRuby?