He knew he didn't have much longer to live.
In Egypt Abraham's family had grown into a nation of many, many people, known as the Israelites.
God had promised that he would make Abraham's family a great nation and give them the land of Canaan.
Joshua told the Israelites,
He also set up a large stone under an oak tree.
1 Corinthians 10:31
Whether you eat or drink or whatever you do, do it all for the glory of God.
For a number of years after his death, the people kept their promise and served God.
As Joshua had warned, God let trouble come to the Israelites.
Their enemies chased them out of their homes, stole their food, and took parts of their land.
God sent leaders, called judges, to help them.
These judges showed the people their sins and, with God's help, led them to victory over their enemies.
"Whenever you see this stone, it will remind you of the promise you made here today to serve the Lord."
"Now serve the Lord with all your hearts. If some of you still have any of the idols your fathers once worshiped, throw them away. Decide today whom you will serve. But as for me and my family, we will serve the Lord."
"We will never turn away from the Lord to serve other gods! We know that God himself did all these great things for us. We too will always serve the Lord, because he is our God!"
Then Joshua warned the people,
"No! That will never happen! We promise that we will serve the Lord our God and obey his commands."