And you went over the Jordan, and came
unto Jericho: and the men of Jericho fought against you, the Amorites, and the Perizzites, and the Canaanites, and the Hittites, and the Girgashites, the Hivites, and the Jebusites; and I delivered them into your hand.
Read Chapter 24
Augustine of Hippo
“And those who inhabited Jericho waged war against you.” One might well ask how this statement could be true, when they were merely protecting themselves by hiding behind the walls and closing the city gates. But this is spoken correctly, since the closing of gates to an enemy is a sign of warfare. For the inhabitants of Jericho did not send ambassadors to ask for terms of peace.… For a war does not always have one battle after another. Some wars have frequent battles, some a few, still others none. A war, however, is when there is a disagreement involving arms in some way. - "Questions on Joshua 26" ...
Men. Hebrew, "the masters of Jericho "which may denote either the king or the inhabitants. It is thought that people of the different nations were come to defend the city, or the text may signify that not only Jericho, but these different people, (Calmet) fought successively against the people of God, but all in vain. (Haydock)
The fighting of the inhabitants of Jericho was only intentional; a miracle rendered all their efforts abortive. Yet this is called fighting in scripture (ver. 9,) as well as in other authors. "We judge of actions by the intention, says St. Isidore: (Pelus. ii. ep. 289,) the person who intended to murder is punished, though he only inflicted a wound; and on the other hand, he who dills undesignedly receives a pardon. "So Orion was said to have violated Diana, because he wished to do it; and Virgil, (Æneid viii.) speaking of some who already thought they were in possession of the capital, says, Galli per dumos aderant, arcemque tenebant, "they seized the citadel ...