if (!Modifier.isStatic(field.getModifiers())) {
javaObject = JavaUtil.unwrapJavaValue(getRuntime(), object, "not a java object: " + object);
}
IRubyObject val = value;
if(val.dataGetStruct() instanceof JavaObject) {
val = (IRubyObject)val.dataGetStruct();
}
try {
Object convertedValue = val.toJava(field.getType());
field.set(javaObject, convertedValue);