Adapt for jruby