first version replacing string by JString