fix endless loop when checking jruby version when checking jruby version, update #2528