a long time after that the Lord had given rest unto Israel from all their enemies--about fourteen years after the conquest of Canaan, and seven after the distribution of that country among the tribes.
ye have seen all that the Lord your God hath done unto all these nations because of you--The modesty and humility of Joshua are remarkably displayed at the commencement of this address. Dismissing all thoughts of his personal services, he ascribed the subjugation and occupation of Canaan entirely to the favoring presence and aid of God; and in doing so, he spoke not more piously than truly. This had been promised (Deu 1:30; Deu 3:22); and the reality of the divine aid was seen in the rapid overthrow of the Canaanites, which had already led to the division of the whole land among the tribes [Jos 23:4].
the Lord your God, he shall expel them from before you, as the Lord your God hath promised you, &c.--The actual possessions which God had given were a pledge of the complete fulfilment of His promise in giving them the parts of the country still unconquered. But the accomplishment of the divine promise depended on their inviolable fidelity to God's law--on their keeping resolutely aloof from all familiar intercourse and intimate connections with the Canaanites, or in any way partaking of their idolatrous sins. In the event of their continuing in steadfast adherence to the cause of God, as happily distinguished the nation at that time, His blessing would secure them a course of brilliant and easy victories (Lev 26:7; Deu 28:7; Deu 32:30).
Else if ye do in any wise go back, and cleave unto the remnant of these nations--As marriage connections with the idolatrous Canaanites would present many and strong temptations to transgress it, these were strictly prohibited (Exo 34:12-16; Deu 7:3). With his eye, as it were, upon those prohibitions, Joshua threatens them with the certain withdrawal of the divine aid in the further expulsion of the Canaanites (a threat founded Exo 23:33; Num 33:55; Deu 7:16).