William Lane Craig has a really good response to those who ask how a just and loving God could command the Israelites to kill every Canaanite (including children). In the same article he makes some poignant distinctions between the Jewish conquest of Canaan and Islamic jihad.