JRuby 1.6.0 is the largest release of JRuby to date. This release
fixes hundreds of user issues and brings compatibility with Ruby 1.9.2
to a very high level. We have made Windows a primary supported
platform by adding it to our continuous integration environment. JRuby
1.6 will provide Windows-based Ruby users with the best experience
yet. This release integrates experimental support for C extensions
based on Ruby’s C API. And as with all major releases, we have
improved stability and performance across the board in response to
real-world user input.
Over the next month or two we plan on putting out quicker point releases
in anticipation that 1.6.0 will get a new wave of feedback. Give JRuby
1.6.0 a try and let us know how things go.
Major Features:
Ruby 1.9.2 language and API compatibility
Not implemented Encoding::Converter, ripper
Improved Ruby call performance
Built-in profiler (–profile, --profile.graph)
RSpec no longer bundled
C Extension support (experimental)
RubyGems Maven support (preview)
Improved compatibility and user experience on Windows
jruby-complete.jar now includes 1.9 standard library
Does this release mean that it is generally safe to use 1.9 style code with
Jruby?
Yes.
Let me expand on that just a bit. JRuby still defaults to the 1.8
syntax, so for running 1.9 code you must pass the --1.9 command line
switch when starting it up. I believe there is a way to make that a
default but I don’t know the exact details. I assume it involves setting
an environment parameter to contain the --1.9 command; I recommend
asking on the JRuby mailing list or joining the #jruby channel on irc.freenode.net and asking there.
$ jruby -v
jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (Java
HotSpot™ 64-Bit Server VM 1.6.0_24) [darwin-x86_64-java]
I use it this way most of the time. The only thing you need to be aware
of
is that 1.9 uses 1.9’s gems, so if you notice that your gem require
stops
working, you probably forgot to install the gem for 1.9.