Notes on the Bible, by Albert Barnes, , at sacred-texts.com
This and the next chapter contain the last addresses of Joshua. These addresses were no doubt among the closing acts of Joshua's life, but were evidently given on different occasions, and are of different character and scope. In the former Joshua briefly reminds the princes of the recent benefits of God toward them and their people, declares that God had fulfilled all His promises, and exhorts to faithfulness on their side to God that so His mercies may not be withdrawn: in the latter he takes a wider range, rehearses the gracious dealings of God with the nation from its very origin, and upon these as his grounds, he claims for God their sincere and entire service. But he grants them the option of withdrawing from the covenant if they so choose; and when they elect still to abide by it, it is solemnly renewed by the free consent of the whole people. Joshua's reproofs and warnings are in sum and substance identical with those with which Moses closed his career (Deut. 31, etc.). Compare throughout the marginal references.
All Israel, and for their elders - Omit "and," which is not in the Hebrew. The meaning is that Joshua summoned to him all Israel as represented by its elders, etc. Deu 1:15. This gathering probably took place at the tabernacle at Shiloh.