you need to use java_class
to get the โcorrectโ class, which is the (wrapped) java.lang.Class
, and not the ruby โโclass, as it is with java.util.Date.class
, for example.
Java::OrgSlf4j::LoggerFactory.getLogger java.util.Date.java_class
since you can use class variables to save โstaticallyโ, but keep in mind that they are shared between the inheritance hierarchy, for example:
@@logger = Java::OrgSlf4j::LoggerFactory.getLogger java.util.Date.java_class
kares source share