Added check on Java enviroments

It fixes an open issue, using Open3 with Jruby, JRuby version (1.7.4)
seems not working http://jira.codehaus.org/browse/JRUBY-6409