Joshua made war a long time with all those kings.
Joshua waged war against all these kings for a long period of time.