What is the best way to define a class that can be instantiated in both Java and JRuby painlessly?

I have a class defined in JRuby. Let’s say it is called MyClass.

My goal is to have it such that in JRuby I can do…

m = MyClass.new

and in java have a function

public boolean isMyClass(Object o) {
return o instanceof MyClass
}

What’s the best way to do this? Write the class in Java? First priority
is
seamlessness, but a close second is to be fast. It’s not a super
complicated
class, so implementing it in Java is definitely feasible, I’m just not
sure
how to make it easily instantiated in both Ruby and Java.

Thanks
Jon