adapt for jruby