Make sure that the Java method is accessible. That is, it must either be public or be in the same package as the caller.