Oracle Blog

Blog for emononen

NetBeans and JRuby

Based on a couple of postings I've seen on the various Ruby and Rails forums on the internet, there seems to be some confusion about how exactly NetBeans and JRuby are integrated. One source of confusion is probably the term we use for the JRuby version bundled with the IDE, i.e. "built-in". It does not mean that the bundled version is modified in any way to work with the IDE; in fact it is just the standard JRuby distribution and the IDE works fine without it. We do bundle some additional gems, e.g. Rails and activerecord-jdbc-adapter for a better out-of-the-box experience, but the JRuby bits themselves are untouched. You can (and generally should) upgrade to a newer version of JRuby whenever one is available; if you add the new version to your PATH environment variable it will be even autodetected by the IDE -- if not, just add it manually using the Platform manager by pointing it to /bin/jruby.

Adding a new platform, Tools -> Ruby Platforms

In addition to JRuby we naturally support Matz's Ruby (MRI) too, and thanks to Martin in the upcoming 6.5 also Rubinius is supported. Managing them is equally straightforward as for JRuby, and the same goes for autodetection. If you run into an issue you don't seem to figure out what could be causing it and suspect it must be the IDE, it is a good idea to try out running the problematic piece of code on another platform to make sure you're not seeing an issue specific to MRI/JRuby/Rubinius -- if that's the case, best to file an issue directly into the issue tracker of that Ruby platform. If unsure, it is perfectly fine to file such issues to our IZ too, eventually they'll be dispatched to the right place.

That said, the IDE does still in fact need a JRuby version that is specific to the IDE, namely the internal one that is used for providing editor features. However, this is not the same JRuby as the user visible one (i.e. the "built-in" version visible in the menus), instead it is completely hidden from the user.