The level of the genocide in the book of Joshua is not as bad as you would think. Compare this with book of Ruth: A foreign woman gives up the practices of her country, takes on the culture and religion of another country, Israel, and becomes the great-grandmother of that countries greatest king, David. A whole book of the Old Testament is dedicated to how a foreigner can become part of the nation. The annihilation of the nations that Israel dispossessed was not total. These people had three choices: They could leave their religion and culture and become part of Israel, they could leave their homes and towns to Israel, or they could face war.

used under a Creative Commons licence.
But even with the total annihilation of the people in the land ruled out, if we take the rabbinic idea that Joshua sent letters to the cities of these seven nations three times, offering them a place in Israel if they gave up their customs, but there are problems with God asking the people the wage war on other nations for both Jewish and Christian theologians, especially the Christians. Jesus told us to love our enemies, so why would God tell his people to wage war?
But there were limits set by God that would limit the bloodshed that are only hinted at In Joshua. There were tribes that were not to be harmed at all mentioned in Deuteronomy 2. The conquest was to take place over a long period of time, this was no shock and awe sudden warfare, and that what were mentioned as cities, as far as we know from the archaeology, were not busy metropolises but small military forts. The battles were not against the rural towns. Only three of these forts are mentioned as being destroyed – Jericho, Ai and Hazor. In any case they were to be offered terms of surrender, “When you draw near to a city to fight against it, offer terms of peace to it. And if it responds to you peaceably and it opens to you, then all the people who are found in it shall do forced labour for you and shall serve you.” Deuteronomy 20:10-11. However all the cities except the Hivites living in Gibeon refused the terms of surrender. After 3 generations these people would be included as Israelites, servitude was not for all time.
The Canaanites were not completely destroyed. This is the difficult bit because the text of Joshua says they were completely destroyed. But this language is only used for the battles. The general language used about the conquest was that of driving the people out. The conquest was not against the people but against their religious practices of worshipping demons and temple prostitution among others. The language of was was different but it was of its time. There is an inscription in Egypt that Pharaoh Merneptah completely wiped out the Israelites. We know this was not an actual wipeout, just the language of a decisive victory. It’s how they wrote in those days. Even today, with video from the front line a lot of what we hear about battles is hype, often conflicting accounts. The accounts are there to show how much greater God is than the puny Canaanite gods.
If we take the idea that Canaanites were completely destroyed we have a big problem within the book of Joshua itself. In Chapter 10 we are told no Canaanites were left alive in Hebron and Debir, in Chapter 15 there are Canaanites living there.
There are two Joshuas in the Bible. In the Old Testament we translate the name Yᵊhôšûa as Joshua, a name meaning the LORD id salvation. In the New Testament this same name is translates as Jesus. It is the same name.
There is a contrast in style between the two Joshuas. One was a military leader who led a conquest, the other is the Prince of Peace. One had a policy of surrender or be driven out, the other subjected himself to the people who occupied the land was captured and executed, not because he was weak, but because he had the strength to overcome and refused. He rejected violence as a way to establish his kingdom, he crossed cultural and ethnic boundaries in order to offer grace and love even to a Canaanite woman. He showed what the heart of God was really like when he suffered on behalf of those who were murdering him. In this second Joshua, Jesus Christ, God himself suffered violence so that violence might be ended forever.
Even knowing this I still have big problems with the Book of Joshua. Going into another country to drive out or subjugate a people has problems when it is a people who are supposed to be showing what it means to be a people of God to the surrounding nations.