fix detecting java for jruby on centos like systems, fix #1919