Use defined? to check for JRuby