Compatibility with 1.8.x, 1.9.x, and JRuby.