update java sample codes