For a long time, Joshua fought against these kings.
Joshua made war a long time with all those kings.
Joshua had waged war a long time [at least five years] with all those kings.
Joshua waged war against all these kings for a long time.