Cache classes considering jruby runtime.