Ecclesiastes 1:12

I the Preacher was king over Israel in Jerusalem.

The Preacher is Solomon, the son of David, who was king over Israel in Jerusalem. The title of the book means the preacher. That statement that he was king over Israel in Jerusalem points to an early date and overthrows the mistaken verdict that the book was a product of the second century B.C.

The book was written about 977, in Solomon's last days, after he had tasted all the pleasures of this world and yielded to all the desires of the heart and flesh in luxury and power and wealth and feasting and wine and women and idolatry. His many wives turned away his heart and led him away, but he repented heartily.

Like the Preacher, he set his heart to seek and search out by wisdom all that is done under heaven, and his wisdom was not acquired suddenly, for God was its source while earnest seeking and searching were the means by which it grew. The verse introduces his record of seeking pleasure in wisdom but finding it not, learning by actual experience that all human wisdom and glory and wealth and popularity and all the luxuries the human mind could invent could not bring rest of soul but produce nothing but vanity and vexation of spirit.

The book graphically points out the folly of earthly pursuits without hope in God and the nothingness of humanity without God, presenting the vanity of human life and the utter uselessness of all human pursuits apart from God, with excellent practical instruction interwoven in the sermon. Through this experience he was forced to confess that all was vanity until he came to the one blessed conclusion that to fear God and keep His commandments is the whole duty of man.