handle command in java