I am waiting on some clothes to dry so I can leave (that will make sense if you have read my previous post titled "Josf". I am going to copy and paste some information http://bible.org/question/how-could-loving-god-tell-israelit...
This portion that I've copied is from the last part of the page. It will probably be easier to read the link than the paste below. You cann read all of it, but this part here is specifically speaking about the scriptures in Joshua that we are discussing.
"Israel was commanded by God to completely exterminate the Canaanite inhabitants of the land including men, women, and children. This has been called a primitive and barbaric act of murder perpetrated on innocent lives.
Several factors must be kept in mind in viewing this situation. (1) There is a difference between murder and justifiable killing. Murder involves intentional and malicious hatred which leads to life-taking. On the other hand, the Bible speaks of permissible life-taking in capital punishment (Gen. 9:), in self defense (Exod. 22:2), and in a justifiable war (Gen. 14). (2) The Canaanites were by no means innocent. They were a people cursed of God from their very beginning (Gen. 9:25). They were a vile people who practiced the basest forms of immorality. God described their sin vividly in these words, “I punished its iniquity, and the land vomited out its inhabitants” (Lev. 18:25). (3) Further, the innocent people of the land were not slaughtered. The story of Sodom and Gomorrah clearly demonstrates that God would save a whole city for ten righteous people (Gen. 18:22f.). In that incident, when God could not find ten righteous people, He took the four or five righteous ones out of the place so as not to destroy them with the wicked (Gen. 19:15). On another occasion God saved some thirty-two thousand people who were morally pure (Num. 31:35). Another notable example is Rahab, whom God saved because she believed (cf. Heb. 11:31). (4) God waited patiently for hundreds of years, giving the wicked inhabitants of Canaan time to repent (cf. 2 Peter 3:9) before He finally decided to destroy them (Gen. 15:16). When their iniquity was “full,” divine judgment fell. God’s judgment was akin to surgery for cancer or amputation of a leg as the only way to save the rest of a sick body. Just as cancer or gangrene contaminates the physical body, those elements in a society—if their evil is left to fester—will completely contaminate the rest of society. (5) Finally, the battle confronting Israel was not simply a religious war; it was a theocratic war. Israel was directly ruled by God and the extermination was God’s direct command (cf. Exod. 23:27-30; Deut. 7:3-6; Josh. 8:24-26). No other nation either before or after Israel has been a theocracy. Thus, those commands were unique. Israel as a theocracy was an instrument of judgment in the hands of God. (Norman L. Geisler, A Popular Survey of the Old Testament, Baker Book House, Grand Rapids, 1977, pp. 99-100.)"